doot.workflow.structs.action_spec
Classes
When an action isn't a full blown class, it gets wrapped in this, |
Module Contents
- class doot.workflow.structs.action_spec.ActionSpec(/, **data: Any)[source]
Bases:
pydantic.BaseModel,jgdv._abstract.protocols.general.Buildable_pWhen an action isn’t a full blown class, it gets wrapped in this, which passes the action spec to the callable.
TODO: recogise arg prefixs and convert to correct type. eg: path:a/relative/path -> Path(./a/relative/path) path:/usr/bin/python -> Path(/usr/bin/python)
- Parameters:
data (Any)
- do: jgdv.Maybe[jgdv.structs.strang.CodeReference] = None
- kwargs: jgdv.structs.chainguard.ChainGuard = None
- fun: jgdv.Maybe[jgdv.Func] = None
- classmethod build(
- data: dict | list | jgdv.structs.chainguard.ChainGuard | ActionSpec,
- *,
- fun: jgdv.Maybe[collections.abc.Callable] = None,
- Parameters:
data (dict | list | jgdv.structs.chainguard.ChainGuard | ActionSpec)
fun (jgdv.Maybe[collections.abc.Callable])
- Return type:
- _validate_do(
- val: jgdv.Maybe[str | jgdv.structs.strang.CodeReference | collections.abc.Callable],
- Parameters:
val (jgdv.Maybe[str | jgdv.structs.strang.CodeReference | collections.abc.Callable])
- Return type:
jgdv.Maybe[jgdv.structs.strang.CodeReference]
- property params: jgdv.structs.chainguard.ChainGuard[source]
- Return type:
jgdv.structs.chainguard.ChainGuard
- set_function(
- *,
- fun: jgdv.Maybe[doot.workflow._interface.Action_p | jgdv.Func | type | ImportError] = None,
Sets the function of the action spec. if given a class, the class is built, if given a callable, that is used directly.
- Parameters:
fun (jgdv.Maybe[doot.workflow._interface.Action_p | jgdv.Func | type | ImportError])
- Return type:
None