• Home
  • Raw
  • Download

Lines Matching +full:path +full:- +full:key

4   - all functions from posix or nt, e.g. unlink, stat, etc.
5 - os.path is either posixpath or ntpath
6 - os.name is either 'posix' or 'nt'
7 - os.curdir is a string representing the current directory (always '.')
8 - os.pardir is a string representing the parent directory (always '..')
9 - os.sep is the (or a most common) pathname separator ('/' or '\\')
10 - os.extsep is the extension separator (always '.')
11 - os.altsep is the alternate pathname separator (None or '/')
12 - os.pathsep is the component separator used in $PATH etc
13 - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
14 - os.defpath is the default search path for executables
15 - os.devnull is the file path of the null device ('/dev/null', etc.)
20 and opendir), and leave all pathname manipulation to os.path
37 "defpath", "name", "path", "devnull", "SEEK_SET", "SEEK_CUR",
50 # Any new dependencies of the os module and/or changes in path separator
61 import posixpath as path namespace
81 import ntpath as path namespace
95 sys.modules['os.path'] = path
96 from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
152 # this and reject it--so HAVE_LCHMOD still won't be defined on such
161 # enough to detect this condition--it only determines whether or not
166 # sufficient. After all--if you have a working fchmodat(), your
203 Super-mkdir; create a leaf directory and all intermediate ones. Works like
204 mkdir, except that any intermediate path segment (not just the rightmost)
210 head, tail = path.split(name)
212 head, tail = path.split(head)
213 if head and tail and not path.exists(head):
217 # Defeats race condition when another thread created the path
229 if not exist_ok or not path.isdir(name):
235 Super-rmdir; remove a leaf directory and all empty intermediate
237 successfully removed, directories corresponding to rightmost path
238 segments will be pruned away until either the whole path is
240 ignored -- they generally mean that a directory was not empty.
244 head, tail = path.split(name)
246 head, tail = path.split(head)
252 head, tail = path.split(head)
257 Super-rename; create directories as necessary and delete any left
261 path segments of the old name will be pruned until either the
262 whole path is consumed or a nonempty directory is found.
269 head, tail = path.split(new)
270 if head and tail and not path.exists(head):
273 head, tail = path.split(old)
286 itself, but excluding '.' and '..'), yields a 3-tuple
290 dirpath is a string, the path to the directory. dirnames is a list of
293 filenames is a list of the names of the non-directory files in dirpath.
294 Note that the names in the lists are just names, with no path components.
295 To get a full path (which begins with top) to a file or directory in
296 dirpath, do os.path.join(dirpath, name).
304 When topdown is true, the caller can modify the dirnames list in-place
333 from os.path import join, getsize
337 print("bytes in", len(files), "non-directory files")
357 # to earlier import-*.
380 # a directory, same behaviour than os.path.isdir().
389 # Bottom-up: recurse into sub-directory, but exclude symlinks to
399 # os.path.islink().
404 walk_dirs.append(entry.path)
410 # Recurse into sub-directories
411 islink, join = path.islink, path.join
414 # Issue #23605: os.path.islink() is used instead of caching
421 # Recurse into sub-directories
434 This behaves exactly like walk(), except that it yields a 4-tuple
460 print("bytes in", len(files), "non-directory files")
473 path.samestat(orig_st, stat(topfd)))):
525 if follow_symlinks or path.samestat(orig_st, stat(dirfd)):
526 dirpath = path.join(toppath, name)
549 env = args[-1]
550 execve(file, args[:-1], env)
555 Execute the executable file (which is searched for along $PATH)
562 Execute the executable file (which is searched for along $PATH)
565 env = args[-1]
566 execvpe(file, args[:-1], env)
571 Execute the executable file (which is searched for along $PATH)
579 Execute the executable file (which is searched for along $PATH)
596 if path.dirname(file):
605 fullname = path.join(dir, file)
634 # {b'PATH': ...}.get('PATH') and {'PATH': ...}.get(b'PATH') emit a
635 # BytesWarning when using python -b or python -bb: ignore the warning
640 path_list = env.get('PATH')
646 path_listb = env[b'PATH']
652 "env cannot contain 'PATH' and b'PATH' keys")
674 def __getitem__(self, key): argument
676 value = self._data[self.encodekey(key)]
678 # raise KeyError with the original key value
679 raise KeyError(key) from None
682 def __setitem__(self, key, value): argument
683 key = self.encodekey(key)
685 putenv(key, value)
686 self._data[key] = value
688 def __delitem__(self, key): argument
689 encodedkey = self.encodekey(key)
694 # raise KeyError with the original key value
695 raise KeyError(key) from None
700 for key in keys:
701 yield self.decodekey(key)
708 f"{self.decodekey(key)!r}: {self.decodevalue(value)!r}"
709 for key, value in self._data.items()
716 def setdefault(self, key, value): argument
717 if key not in self:
718 self[key] = value
719 return self[key]
748 def encodekey(key): argument
749 return encode(key).upper()
751 for key, value in environ.items():
752 data[encodekey(key)] = value
773 def getenv(key, default=None): argument
776 key, default and the result are str."""
777 return environ.get(key, default)
794 def getenvb(key, default=None): argument
797 key, default and the result are bytes."""
798 return environb.get(key, default)
812 filename = fspath(filename) # Does type-checking of `filename`.
824 filename = fspath(filename) # Does type-checking of `filename`.
875 """spawnv(mode, file, args) -> integer
880 otherwise return -SIG, where SIG is the signal that killed it. """
884 """spawnve(mode, file, args, env) -> integer
890 otherwise return -SIG, where SIG is the signal that killed it. """
896 """spawnvp(mode, file, args) -> integer
898 Execute file (which is looked for along $PATH) with arguments from
902 otherwise return -SIG, where SIG is the signal that killed it. """
906 """spawnvpe(mode, file, args, env) -> integer
908 Execute file (which is looked for along $PATH) with arguments from
912 otherwise return -SIG, where SIG is the signal that killed it. """
924 """spawnl(mode, file, *args) -> integer
929 otherwise return -SIG, where SIG is the signal that killed it. """
933 """spawnle(mode, file, *args, env) -> integer
939 otherwise return -SIG, where SIG is the signal that killed it. """
940 env = args[-1]
941 return spawnve(mode, file, args[:-1], env)
951 """spawnlp(mode, file, *args) -> integer
953 Execute file (which is looked for along $PATH) with arguments from
957 otherwise return -SIG, where SIG is the signal that killed it. """
961 """spawnlpe(mode, file, *args, env) -> integer
963 Execute file (which is looked for along $PATH) with arguments from
967 otherwise return -SIG, where SIG is the signal that killed it. """
968 env = args[-1]
969 return spawnvpe(mode, file, args[:-1], env)
978 def popen(cmd, mode="r", buffering=-1):
999 # Helper for popen() -- a proxy for a file whose close waits for the process
1025 def fdopen(fd, mode="r", buffering=-1, encoding=None, *args, **kwargs):
1036 def _fspath(path): argument
1037 """Return the path representation of a path-like object.
1040 os.PathLike interface is used to get the path representation. If the
1041 path representation is not str or bytes, TypeError is raised. If the
1042 provided path is not str, bytes, or os.PathLike, TypeError is raised.
1044 if isinstance(path, (str, bytes)):
1045 return path
1049 path_type = type(path)
1051 path_repr = path_type.__fspath__(path)
1074 """Abstract base class for implementing the file system path protocol."""
1078 """Return the file system path representation of the object."""
1092 def __init__(self, path, cookie, remove_dll_directory): argument
1093 self.path = path
1098 self.path = None
1104 if self.path:
1105 return "<AddedDllDirectory({!r})>".format(self.path)
1108 def add_dll_directory(path): argument
1109 """Add a path to the DLL search path.
1111 This search path is used when resolving dependencies for imported
1112 extension modules (the module itself is resolved through sys.path),
1119 cookie = nt._add_dll_directory(path)
1121 path,