jgdv._abstract.protocols.general
Protocols
For things have multiple named groups of actions |
|
Base class for artifacts, for type matching |
|
For things that need building, but don't have a separate factory |
|
Protocol for classes with a dependency injectable logger |
|
Runners pass off to Tasks/Jobs implementing this protocol |
|
Factory protocol: {type}.build |
|
Base class for protocol classes. |
|
A Specification that can be instantiated further |
|
The protocol for something that will load something from the system, a file, etc |
|
The core protocol of something use as a name |
|
A Protocol for persisting data |
|
Base class for specs, for type matching |
|
Base class for stubs, for type matching |
|
Something that can be turned into toml |
|
For things (often artifacts) which might need to have actions done if they were created too long ago |
|
Base class for protocol classes. |
Module Contents
- class jgdv._abstract.protocols.general.ActionGrouper_p[source]
Bases:
ProtocolFor things have multiple named groups of actions
- class jgdv._abstract.protocols.general.ArtifactStruct_p[source]
Bases:
ProtocolBase class for artifacts, for type matching
- class jgdv._abstract.protocols.general.Buildable_p[source]
Bases:
ProtocolFor things that need building, but don’t have a separate factory TODO add type parameter
- class jgdv._abstract.protocols.general.DILogger_p[source]
Bases:
ProtocolProtocol for classes with a dependency injectable logger
- class jgdv._abstract.protocols.general.ExecutableTask[source]
Bases:
ProtocolRunners pass off to Tasks/Jobs implementing this protocol instead of using their default logic
- class jgdv._abstract.protocols.general.Factory_p[source]
Bases:
ProtocolFactory protocol: {type}.build
- class jgdv._abstract.protocols.general.FailHandler_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: ...
- class jgdv._abstract.protocols.general.InstantiableSpecification_p[source]
Bases:
ProtocolA Specification that can be instantiated further
- class jgdv._abstract.protocols.general.Loader_p[source]
Bases:
ProtocolThe protocol for something that will load something from the system, a file, etc TODO add a type parameter
- setup(extra_config) <Unknown>[source]
- Parameters:
extra_config (ChainGuard)
- Return type:
Self
- class jgdv._abstract.protocols.general.Nameable_p[source]
Bases:
ProtocolThe core protocol of something use as a name
- class jgdv._abstract.protocols.general.Persistent_p[source]
Bases:
ProtocolA Protocol for persisting data
- read(target) <Unknown>[source]
- Parameters:
target (pathlib.Path)
- Return type:
None
- write(target) <Unknown>[source]
- Parameters:
target (pathlib.Path)
- Return type:
None
- class jgdv._abstract.protocols.general.SpecStruct_p[source]
Bases:
ProtocolBase class for specs, for type matching
- property params: dict | ChainGuard[source]
- Return type:
- class jgdv._abstract.protocols.general.StubStruct_p[source]
Bases:
ProtocolBase class for stubs, for type matching
- class jgdv._abstract.protocols.general.TomlStubber_p[source]
Bases:
ProtocolSomething that can be turned into toml
- classmethod stub_class(stub) <Unknown>[source]
- Parameters:
stub (StubStruct_p)
- Return type:
None
- stub_instance(stub) <Unknown>[source]
- Parameters:
stub (StubStruct_p)
- Return type:
None
- class jgdv._abstract.protocols.general.UpToDate_p[source]
Bases:
ProtocolFor things (often artifacts) which might need to have actions done if they were created too long ago
- class jgdv._abstract.protocols.general.Visitor_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: ...