Package pathaddition :: Module relative
[hide private]
[frames] | no frames]

Module relative

source code

Additional path functionnality. abs2rel rel2abs

Functions [hide private]
 
isabs(string)
@return true if string is an absolute path or protocoladdress for addresses beginning in http:// or ftp:// or ldap:// - they are considered "absolute" paths.
source code
 
rel2abs(path, base=None)
converts a relative path to an absolute path.
source code
 
pathsplit(p, rest=None)
Split path to pieces
source code
 
commonpath(l1, l2, common=None)
return the common path
source code
 
relpath(p1, p2) source code
 
abs2rel(path, base=None)
@return a relative path from base to path.
source code
 
commonprefix(paths)
Returns the common prefix base on the path components.
source code
Variables [hide private]
  protocolPattern = re.compile(r'^\w+://')
Function Details [hide private]

rel2abs(path, base=None)

source code 

converts a relative path to an absolute path.

@param path the path to convert - if already absolute, is returned without conversion. @param base - optional. Defaults to the current directory. The base is intelligently concatenated to the given relative path. @return the relative path of path from base

abs2rel(path, base=None)

source code 

@return a relative path from base to path.

base can be absolute, or relative to curdir, or defaults to curdir.