jgdv.structs.locator._interface
Type Aliases
Protocols
Something which describes a file system location, |
|
Base class for protocol classes. |
Classes
Available metadata attachable to a location |
|
Ways a path can have a wildcard. |
Module Contents
- jgdv.structs.locator._interface.TimeDelta: TypeAlias = datetime.timedelta
- class jgdv.structs.locator._interface.Location_p[source]
Bases:
jgdv.structs.strang._interface.Strang_p,ProtocolSomething which describes a file system location, with a possible identifier, and metadata
- check_wildcards(other) <Unknown>[source]
- Parameters:
other (pathlib.Path | Location_p)
- Return type:
- Marks: ClassVar[jgdv.structs.strang._interface.StrangMarkAbstract_e]
- Wild: ClassVar[jgdv.structs.strang._interface.StrangMarkAbstract_e]
- property key: jgdv.Maybe[str | jgdv.structs.dkey._interface.Key_p][source]
- Return type:
jgdv.Maybe[str | jgdv.structs.dkey._interface.Key_p]
- property path: pathlib.Path[source]
- Return type:
- class jgdv.structs.locator._interface.Locator_p[source]
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto[T](Protocol): def meth(self) -> T: ...
- expand(
- key,
- *,
- strict=True,
- norm=True,
- Parameters:
key (Location_p | pathlib.Path | jgdv.structs.dkey._interface.Key_p | str)
strict (bool)
norm (bool)
- Return type:
jgdv.Maybe[pathlib.Path]
- metacheck(key, *meta) <Unknown>[source]
- Parameters:
meta (LocationMeta_e)
- Return type:
- class jgdv.structs.locator._interface.LocationMeta_e[source]
Bases:
jgdv.structs.strang._interface.StrangMarkAbstract_eAvailable metadata attachable to a location
- abstract = 'abstract'
- artifact = 'artifact'
- clean = 'clean'
- dir
- directory = 'directory'
- earlycwd = 'earlycwd'
- expand = 'expand'
- file = 'file'
- loc
- location = 'location'
- partial = 'partial'
- protect = 'protect'
- remote = 'remote'