Home | History | Annotate | Download | only in Lib

Lines Matching refs:path

5 module as os.path.
22 # strings representing various path-related bits and pieces
47 path = a
50 path = b
51 elif path == '' or path[-1:] in '/\\:':
52 path = path + b
54 path = path + '/' + b
55 return path
60 """Split a pathname into UNC mount point and relative path specifiers.
64 using backslashes). unc+rest is always the input path.
71 # is a UNC path:
78 ##raise RuntimeError, 'illegal UNC path: "' + p + '"'
87 # Return the tail (basename) part of a path.
94 # Return the head (dirname) part of a path.
105 # Is a path a directory?
107 # Is a path a mount point? Either a root (with or without drive letter)
108 # or a UNC path with at most a / or \ after the mount point.
110 def ismount(path):
111 """Test whether a path is a mount point (defined as root of drive)"""
112 unc, rest = splitunc(path)
115 p = splitdrive(path)[1]
119 # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
121 def normpath(path):
122 """Normalize path, eliminating double slashes, etc."""
123 path = path.replace('\\', '/')
124 prefix, path = splitdrive(path)
125 while path[:1] == '/':
127 path = path[1:]
128 comps = path.split('/')
140 # If the path is now empty, substitute '.'
146 # Return an absolute path.
147 def abspath(path):
148 """Return the absolute version of a path"""
149 if not isabs(path):
150 if isinstance(path, _unicode):
154 path = join(cwd, path)
155 return normpath(path)