cellpy.internals.core
#
This module contains div classes etc that are not really connected to cellpy.
Module Contents#
Classes#
Mock of os.stat_result. |
|
A pathlib.Path subclass that can handle external paths. |
Attributes#
- class OtherPath(*args, **kwargs)[source]#
Bases:
pathlib.Path
A pathlib.Path subclass that can handle external paths.
- rglob(method)[source]#
a method for ‘recursive’ globbing external paths (max one extra level deep) if
is_external
is True.
Construct a PurePath from one or several strings and or existing PurePath objects. The strings and path objects are combined so as to yield a canonicalized path, which is incorporated into the new PurePath object.
- property pathlike_location: S[source]#
Return the location of the external path as a pathlike object.
- absolute() S [source]#
Return an absolute version of this path by prepending the current working directory. No normalization or symlink resolution is performed.
Use resolve() to get the canonical path to a file.
- connection_info(testing: bool = False) Tuple[Dict, str] [source]#
Return a dictionary with connection information.
- copy(destination: pathlib.Path | None = None, testing=False) pathlib.Path [source]#
Copy the file to a destination.
- glob(glob_str: str, *args, **kwargs) Generator [source]#
Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.
- iterdir(*args, **kwargs)[source]#
Yield path objects of the directory contents.
The children are yielded in arbitrary order, and the special entries ‘.’ and ‘..’ are not included.
- joinpath(*args, **kwargs)[source]#
Combine this path with one or several arguments, and return a new path representing either a subpath (if all arguments are relative paths) or a totally different path (if one of the arguments is anchored).
- lchmod(*args, **kwargs)[source]#
Like chmod(), except if the path points to a symlink, the symlink’s permissions are changed, rather than its target’s.
- listdir(levels: int = 1, **kwargs) Generator [source]#
List the contents of the directory.
- Parameters:
levels (int, optional) –
How many sublevels to list:
If you want to list all sublevels, use
listdir(levels=-1)
.If you want to list only the current level (no subdirectories), use
listdir(levels=0)
.
- Returns:
Generator of
OtherPath
objects.- Return type:
Generator
- rglob(glob_str: str, *args, **kwargs) Generator [source]#
Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree.
- samefile(other_path: str | pathlib.Path | S) bool [source]#
Return whether other_path is the same or not as this file (as returned by os.path.samefile()).