Changeset 102:81fa8517d4b8

Show
Ignore:
Timestamp:
2007-07-11 15:27:08 (1 year ago)
Author:
Stefan Schwarzer <sschwarzer@sschwarzer.net>
branch:
default
Message:
Renamed module `path` to `urlpath`.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • test.py

    r100 r102  
    3131import coding 
    3232import config 
    33 import path 
     33import urlpath 
    3434 
    3535 
  • urlpath.py

    r101 r102  
    2525 
    2626 
    27 URLSEP = "/" 
     27sep = "/" 
    2828 
    2929class NotUnderRoot(Exception): 
     
    6060 
    6161    >>> path.to_url("/the/root/", "/not/in/root/somedir/somefile/") 
     62    ... #doctest: +ELLIPSIS 
    6263    Traceback (most recent call last): 
    6364        ... 
    64     NotUnderRoot: path "/not/in/root/somedir/somefile" isn't under root directory "/the/root
     65    NotUnderRoot: path "..." isn't under root directory "...
    6566    """ 
    6667    # convert path separators 
    67     root = root.replace(os.sep, URLSEP
    68     path = path.replace(os.sep, URLSEP
     68    root = root.replace(os.sep, sep
     69    path = path.replace(os.sep, sep
    6970    # remove trailing slashes 
    70     root = root.rstrip(URLSEP
    71     path = path.rstrip(URLSEP
     71    root = root.rstrip(sep
     72    path = path.rstrip(sep
    7273    # convert 
    7374    if not path.startswith(root):