Home | History | Annotate | Download | only in python2.7

Lines Matching refs:path

5 module as os.path.
21 # strings representing various path-related bits and pieces
46 path = a
49 path = b
50 elif path == '' or path[-1:] in '/\\:':
51 path = path + b
53 path = path + '/' + b
54 return path
59 """Split a pathname into UNC mount point and relative path specifiers.
63 using backslashes). unc+rest is always the input path.
70 # is a UNC path:
77 ##raise RuntimeError, 'illegal UNC path: "' + p + '"'
86 # Return the tail (basename) part of a path.
93 # Return the head (dirname) part of a path.
104 # Is a path a directory?
106 # Is a path a mount point? Either a root (with or without drive letter)
107 # or an UNC path with at most a / or \ after the mount point.
109 def ismount(path):
110 """Test whether a path is a mount point (defined as root of drive)"""
111 unc, rest = splitunc(path)
114 p = splitdrive(path)[1]
118 # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
120 def normpath(path):
121 """Normalize path, eliminating double slashes, etc."""
122 path = path.replace('\\', '/')
123 prefix, path = splitdrive(path)
124 while path[:1] == '/':
126 path = path[1:]
127 comps = path.split('/')
139 # If the path is now empty, substitute '.'
145 # Return an absolute path.
146 def abspath(path):
147 """Return the absolute version of a path"""
148 if not isabs(path):
149 if isinstance(path, unicode):
153 path = join(cwd, path)
154 return normpath(path)