doot.control.main
Type Aliases
Classes
mixin for triggering full loading |
|
mixin for cli arg processing |
|
mixin for actually running a command |
|
mixin for cleaning up on and shutting down doot |
|
Mixin for handling different errors of doot |
|
doot.main and the associated exit handlers |
Module Contents
- doot.control.main.DataSource: TypeAlias = dict | ChainGuard
- class doot.control.main.LoadingController[source]
mixin for triggering full loading
- DM: TypeAlias = Main_p
- update_command_aliases(obj: DM) None[source]
Read settings.commands.* and register aliases
commands use doot.config.settings.commands.NAME, and within that, ‘aliases’ gives a dict of {alias=[args]}
eg: commands.list.aliases.acts = [’–actions’] .. aliases ‘doot acts’ .. to equiv of ‘doot list –actions’
- Parameters:
obj (DM)
- Return type:
None
- class doot.control.main.CLIController[source]
mixin for cli arg processing
- DM: TypeAlias = DootMain
- parse_args(
- obj: DM,
- *,
- override: jgdv.Maybe[list] = None,
use loaded cmd and tasks to parse sys.argv
- Parameters:
obj (DM)
override (jgdv.Maybe[list])
- Return type:
None
- _load_cli_parser(
- obj: DM,
- *,
- target: str = 'default',
- Parameters:
obj (DM)
target (str)
- Return type:
jgdv.cli.ParseMachine
- class doot.control.main.CmdController[source]
mixin for actually running a command
- DM: TypeAlias = DootMain
- get_cmd_instance(
- obj: DM,
- *,
- cmd: str,
Uses the full command name to get the instance of the command
- Parameters:
obj (DM)
cmd (str)
- Return type:
- class doot.control.main.ShutdownController[source]
mixin for cleaning up on and shutting down doot
- DM: TypeAlias = DootMain
- shutdown(obj: DM) None[source]
Doot has finished, report on what was done and how doot finished
- Parameters:
obj (DM)
- Return type:
None
- install_handler(obj: DM) None[source]
Install an exit handler
- Parameters:
obj (DM)
- Return type:
None
- class doot.control.main.ErrorHandlers[source]
Mixin for handling different errors of doot
- DM: TypeAlias = DootMain
- _early_exit( ) int[source]
- Parameters:
err (doot.errors.EarlyExit | doot.errors.Interrupt | bdb.BdbQuit)
- Return type:
- _config_error_exit(
- err: doot.errors.ConfigError,
- Parameters:
err (doot.errors.ConfigError)
- Return type:
- _task_failed_exit(
- err: doot.errors.TaskError,
- Parameters:
err (doot.errors.TaskError)
- Return type:
- _bad_state_exit(
- err: doot.errors.StateError,
- Parameters:
err (doot.errors.StateError)
- Return type:
- _bad_struct_exit(
- err: doot.errors.StructLoadError,
- Parameters:
err (doot.errors.StructLoadError)
- Return type:
- _tracking_exit(
- err: doot.errors.TrackingError,
- Parameters:
err (doot.errors.TrackingError)
- Return type:
- _backend_exit(
- err: doot.errors.BackendError,
- Parameters:
err (doot.errors.BackendError)
- Return type:
- _frontend_exit(
- err: doot.errors.FrontendError,
- Parameters:
err (doot.errors.FrontendError)
- Return type:
- _misc_doot_exit(err: doot.errors.DootError) int[source]
- Parameters:
err (doot.errors.DootError)
- Return type:
- _not_implemented_exit(
- err: NotImplementedError,
- Parameters:
err (NotImplementedError)
- Return type:
- class doot.control.main.DootMain(*, cli_args: jgdv.Maybe[list] = None)[source]
Bases:
jgdv.cli.ParamSpecMaker_mdoot.main and the associated exit handlers
Error’s if doot hasn’t got an overlord (aliased as the doot package)
loads values from the overlord config, sets up runtime plugin system
- Parameters:
cli_args (jgdv.Maybe[list])
- _loading: ClassVar[LoadingController]
- _cli: ClassVar[CLIController]
- _cmd: ClassVar[CmdController]
- _shutdown: ClassVar[ShutdownController]
- _err: ClassVar[ErrorHandlers]
- current_cmd: jgdv.Maybe[doot.cmds._interface.Command_p]
- _help_txt = ('A Toml Specified Task Runner',)
- parser = None
- log_config