Lines Matching refs:path

50     """A flavour implements a particular (platform-specific) set of path
104 # Same drive => second path is relative to the first
107 # Second path is non-anchored (common case)
133 # * '\\?\c:\a' is an extended path, which bypasses normal Windows API
134 # path processing. Thus relative paths are not resolved and slash is not
135 # translated to backslash. It has the native NT path limit of 32767
141 # The only path separator at the filesystem level is backslash.
160 # is a UNC path:
167 # a UNC path can't have two slashes in a row
218 def make_uri(self, path):
220 drive = path.drive
222 # It's a path on a local drive => 'file:///c:/a/b'
223 rest = path.as_posix()[2:].lstrip('/')
227 # It's a path on a network drive => 'file://host/share/a/b'
228 return 'file:' + urlquote_from_bytes(path.as_posix().encode('utf-8'))
242 # According to POSIX path resolution:
266 def make_uri(self, path):
267 # We represent the path using the local filesystem encoding,
269 bpath = bytes(path)
289 raise ValueError("Invalid pattern: '**' can only be an entire path component")
302 of a given path."""
339 path = parent_path._make_child_relpath(self.name)
340 if (is_dir if self.dironly else exists)(path):
341 for p in self.successor._select_from(path, is_dir, exists, scandir):
371 path = parent_path._make_child_relpath(name)
372 for p in self.successor._select_from(path, is_dir, exists, scandir):
396 path = parent_path._make_child_relpath(entry.name)
397 for p in self._iterate_directories(path, is_dir, scandir):
424 of a path. Don't try to construct it yourself."""
427 def __init__(self, path):
429 self._pathcls = type(path)
430 self._drv = path._drv
431 self._root = path._root
432 self._parts = path._parts
458 PurePath represents a filesystem path and offers operations which
471 PurePath objects. The strings and path objects are combined so as
472 to yield a canonicalized path, which is incorporated into the
480 # Using the parts tuple helps share interned path parts
537 """Return the string representation of the path, suitable for
550 """Return the string representation of the path with forward (/)
556 """Return the bytes representation of the path. This is only
564 """Return the path as a 'file' URI."""
566 raise ValueError("relative path can't be expressed as a file URI")
611 doc="""The drive prefix (letter or UNC path), if any.""")
614 doc="""The root of the path, if any.""")
624 """The final path component, if any."""
659 """The final path component, minus its last suffix."""
668 """Return a new path with the file name changed."""
679 """Return a new path with the stem changed."""
683 """Return a new path with the file suffix changed. If the path
685 string, remove the suffix from the path.
704 """Return the relative path to another path identified by the passed
706 a subpath of the other path), raise ValueError.
731 " OR one path is relative and the other is absolute."
737 """Return True if the path is relative to another path or False.
748 components in the filesystem path."""
758 """Combine this path with one or several arguments, and return a
759 new path representing either a subpath (if all arguments are relative
760 paths) or a totally different path (if one of the arguments is
779 """The logical parent of the path."""
789 """A sequence of this path's logical parents."""
793 """True if the path is absolute (has both a root and, if applicable,
800 """Return True if the path contains one of the special names reserved
806 Return True if this path matches the given pattern.
860 Path represents a filesystem path but unlike PurePath, also offers
861 methods to do system calls on path objects. Depending on your system,
879 # a single part relative to this path.
884 # In previous versions of pathlib, __exit__() marked this path as
904 """Return a new path pointing to the current working directory
911 """Return a new path pointing to the user's home directory (as
912 returned by os.path.expanduser('~')).
918 (as returned by os.path.samefile()).
925 return os.path.samestat(st, other_st)
972 """Return an absolute version of this path by prepending the current
975 Use resolve() to get the canonical path to a file.
983 Make the path absolute, resolving all symlinks on the way and also
993 s = os.path.realpath(self, strict=strict)
1010 Return the result of the stat() system call on this path, like
1039 Open the file pointed by this path and return a file object, as
1083 Return the path to which the symbolic link points.
1113 Create a new directory at this given path.
1130 Change the permissions of the path, like os.chmod().
1136 Like chmod(), except if the path points to a symlink, the symlink's
1144 If the path is a directory, use rmdir() instead.
1160 Like stat(), except if the path points to a symlink, the symlink's
1167 Rename this path to the target path.
1169 The target path may be absolute or relative. Relative paths are
1173 Returns the new Path instance pointing to the target path.
1180 Rename this path to the target path, overwriting if that path exists.
1182 The target path may be absolute or relative. Relative paths are
1186 Returns the new Path instance pointing to the target path.
1193 Make this path a symlink pointing to the target path.
1202 Make this path a hard link pointing to the same file as *target*.
1212 Make the target path a hard link pointing to this path.
1214 Note this function does not make this path a hard link to *target*,
1232 Whether this path exists.
1241 # Non-encodable path
1247 Whether this path is a directory.
1258 # Non-encodable path
1263 Whether this path is a regular file (also True for symlinks pointing
1275 # Non-encodable path
1280 Check if this path is a POSIX mount point
1300 Whether this path is a symbolic link.
1310 # Non-encodable path
1315 Whether this path is a block device.
1326 # Non-encodable path
1331 Whether this path is a character device.
1342 # Non-encodable path
1347 Whether this path is a FIFO.
1358 # Non-encodable path
1363 Whether this path is a socket.
1374 # Non-encodable path
1378 """ Return a new path with expanded ~ and ~user constructs
1379 (as returned by os.path.expanduser)
1383 homedir = os.path.expanduser(self._parts[0])