This is an autogenerated API Doc for the module "urlpath".
It was generated on: Monday, January 01 06:46 PM.
def nativejoin(base, path):
Joins two paths - returning a native file path.
Given a base path and a relative location, (in posix format) return a file path in a (relatively) OS native way.
def pathjoin(base, *paths):
Join paths to a base, observing pardir.
def relpath(origin, dest):
Given two absolute paths, work out a path from origin to destination.
Assumes UNIX/URL type relative paths. If origin doesn't end with '/' we assume it's a file rather than a directory.
- If the same paths are passed in :
- if the path ends with ('/') then we return '' else we return the last part of the path (presumably a filename)
If origin or dest don't start with '/' then we add it.
- We are assuming relative paths on the same device
- (i.e. same top level directory)
def relpathto(thisdir, origin, dest):
Given two paths relative to a directory, work out a path from origin to destination.
Assumes UNIX/URL type relative paths. If origin doesn't end with '/' we assume it's a file rather than a directory.
def testJoin():
def testRelpath():
def testRelpathto():
def testRelpathto2():
def tslash(apath):
Add a trailing slash to a path if it needs one.
Doesn't use os.sep because you end up jiggered on windoze - when you want separators for URLs.