.. _doot.workflow.task: ================== doot.workflow.task ================== .. py:module:: doot.workflow.task .. autoapi-nested-parse:: A Utility implementation of most of what a task needs Classes ------- .. autoapisummary:: doot.workflow.task._TaskActionPrep_m doot.workflow.task._TaskProperties_m doot.workflow.task._TaskStubbing_m doot.workflow.task._TaskHelp_m doot.workflow.task.DootTask Module Contents =============== .. doot.workflow.task._TaskActionPrep_m: .. py:class:: _TaskActionPrep_m .. py:method:: prepare_actions() -> None if the task/action spec requires particular action ctors, load them. if the action spec doesn't have a ctor, use the task's action_ctor collects any action errors together, then raises them as a task error .. doot.workflow.task._TaskProperties_m: .. py:class:: _TaskProperties_m .. py:method:: param_specs() -> list[jgdv.cli.ParamSpec] :classmethod: make class parameter specs .. py:property:: name :type: doot.workflow.structs.TaskName .. py:property:: short_doc :type: str Generate Job Class 1 line help string .. py:property:: doc :type: list[str] .. py:property:: is_stale :type: bool .. doot.workflow.task._TaskStubbing_m: .. py:class:: _TaskStubbing_m .. py:method:: stub_class(stub: doot.cmds.structs.task_stub.TaskStub) -> doot.cmds.structs.task_stub.TaskStub :classmethod: Create a basic toml stub for this task .. py:method:: stub_instance(stub: doot.cmds.structs.task_stub.TaskStub) -> doot.cmds.structs.task_stub.TaskStub extend the class toml stub with details from this instance .. doot.workflow.task._TaskHelp_m: .. py:class:: _TaskHelp_m .. py:method:: class_help() -> list[str] :classmethod: Task *class* help. .. _doot.workflow.task.DootTask: .. py:class:: DootTask(spec: doot.workflow._interface.TaskSpec_i, *, action_ctor: jgdv.Maybe[collections.abc.Callable] = None, **kwargs: Any) The simplest task, which can import action classes. eg: actions = [ {do = "doot.workflow.actions.shell_action:DootShellAction", args = ["echo", "this is a test"] } ] Actions are imported upon task creation. .. py:attribute:: Flags :type: ClassVar[type[doot.workflow._interface.TaskMeta_e]] .. py:attribute:: INITIAL_STATE :type: ClassVar[doot.workflow._interface.TaskStatus_e] .. py:attribute:: COMPLETE_STATES :type: ClassVar[set[doot.workflow._interface.TaskStatus_e]] .. py:attribute:: _default_flags :type: ClassVar .. py:attribute:: action_ctor :type: type .. py:attribute:: _help :type: tuple[str, Ellipsis] :value: ('The Simplest Task',) .. py:attribute:: _version :type: str :value: '0.1' .. py:attribute:: _internal_state :type: dict .. py:attribute:: flags .. py:attribute:: _spec .. py:attribute:: _priority .. py:attribute:: _status .. py:property:: name :type: doot.workflow._interface.TaskName_p .. py:property:: spec :type: doot.workflow._interface.TaskSpec_i .. py:property:: status :type: doot.workflow._interface.TaskStatus_e .. py:property:: priority :type: int .. py:property:: internal_state :type: dict .. py:method:: prepare_actions() -> None if the task/action spec requires particular action ctors, load them. if the action spec doesn't have a ctor, use the task's action_ctor collects any action errors together, then raises them as a task error .. py:method:: log(msg: str | jgdv.Lambda | list, level: int = logmod.DEBUG, prefix: jgdv.Maybe[str] = None) -> None utility method to log a message, useful as tasks are running .. py:method:: get_action_group(group_name: str) -> list[doot.workflow._interface.ActionSpec_i]