Lines Matching +full:- +full:- +full:preserve +full:- +full:paths
1 # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
24 # strings representing various path-related bits and pieces
51 # Trivial in Posix, harder on the Mac or MS-DOS.
62 # Join two (or more) paths.
63 def join(path, *paths): argument
66 for p in paths:
83 if result_path and result_path[-1] not in '\\/':
86 ## add separator between UNC and non-absolute path
88 result_drive and result_drive[-1:] != ':'):
98 Returns a 2-tuple (drive_or_unc, path); either part may be empty.
112 Paths cannot contain both a drive letter and a UNC path.
123 if index == -1:
130 if index2 == -1:
137 # Parse UNC paths
141 Return a 2-tuple (unc, rest); either part may be empty.
144 Paths containing drive letters never have a UNC part.
163 if index2 == -1:
183 while i and p[i-1] not in '/\\':
184 i = i - 1
188 while head2 and head2[-1] in '/\\':
189 head2 = head2[:-1]
256 may modify the fnames list in-place (e.g. via del or slice assignment),
276 # Expand paths beginning with '~' or '~user'.
282 # (A function should also be defined to do full *sh-style environment
314 # Expand paths containing shell variable substitutions.
316 # - no expansion within single quotes
317 # - '$$' is translated into '$'
318 # - '%%' is translated into '%' if '%%' are not seen in %var1%%var2%
319 # - ${varname} is accepted.
320 # - $varname is accepted.
321 # - %varname% is accepted.
322 # - varnames can be made out of letters, digits and the characters '_-'
334 varchars = string.ascii_letters + string.digits + '_-'
355 index = pathlen - 1
367 index = pathlen - 1
390 index = pathlen - 1
404 index = index - 1
417 # Preserve unicode (if path is unicode)
420 # in the case of paths with these prefixes:
421 # \\.\ -> device names
422 # \\?\ -> literal paths
437 # No drive letter - preserve initial backslashes
442 # We have a drive letter - collapse initial backslashes
452 if i > 0 and comps[i-1] != '..':
453 del comps[i-1:i+1]
454 i -= 1
471 except ImportError: # not running on Windows - mock up something sensible
490 pass # Bad path - return unchanged.
497 # realpath is a no-op on systems without islink support
521 raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
537 rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
545 # This is overkill on Windows - just pass the path to GetFileAttributes