doot.control.overlord
Type Aliases
Classes
The main control point of Doot |
|
A Facade for the overlord, to be used as the module class |
Module Contents
- doot.control.overlord.Logger: TypeAlias = logmod.Logger
- class doot.control.overlord.StartupController[source]
- DO: TypeAlias = DootOverlord
- null_setup(obj: DO) None[source]
Doesn’t load anything but constants, Used for initialising Doot when testing. Doesn’t set the is_setup flag.
- Parameters:
obj (DO)
- Return type:
None
- setup( ) None[source]
The core requirement to call before any other doot code is run. loads the config files, so everything else can retrieve values when imported.
prefix removes a prefix from the loaded data. eg: ‘tool.doot’ for if putting doot settings in a pyproject.toml
targets=False is for loading nothing, for testing
- _load_constants(
- obj: DO,
- *,
- target: jgdv.Maybe[Loadable] = None,
Load the override constants if the loaded base config specifies one Modifies the global doot.constants
- Parameters:
obj (DO)
target (jgdv.Maybe[Loadable])
- Return type:
None
- class doot.control.overlord.PluginsController[source]
- DO: TypeAlias = DootOverlord
- _load_plugins(obj: DootOverlord) None[source]
Use the plugin loader to find all applicable `importlib.EntryPoint`s
- Parameters:
obj (DootOverlord)
- Return type:
None
- _load_commands(
- obj: DootOverlord,
- *,
- loader: str = 'default',
Select Commands from the discovered loaded_plugins, using the preferred cmd loader or the default
- Parameters:
obj (DootOverlord)
loader (str)
- Return type:
None
- _load_tasks(
- obj: DootOverlord,
- *,
- loader: str = 'default',
Load task entry points, using the preferred task loader, or the default
- Parameters:
obj (DootOverlord)
loader (str)
- Return type:
None
- class doot.control.overlord.DootOverlord(*args: Any, **kwargs: Any)[source]
The main control point of Doot The setup logic of doot.
As Doot uses loaded config data throughout, using the doot.config.on_fail… pattern, the top-level package ‘doot’, uses a module getattr to offload attribute access to this class.
Adapted from https://stackoverflow.com/questions/880530
- Parameters:
args (Any)
kwargs (Any)
- _startup: ClassVar[StartupController]
- _plugin: ClassVar[PluginsController]
- configs_loaded_from: list[str | pathlib.Path]
- config
- constants
- aliases
- loaded_plugins
- loaded_cmds
- loaded_tasks
- cmd_aliases
- args
- locs
- property report: doot.reporters._interface.Reporter_p[source]
- Return type:
- verify_config_version(
- ver: jgdv.Maybe[str],
- source: jgdv.Maybe[str | pathlib.Path],
- *,
- override: jgdv.Maybe[str] = None,
Ensure the config file is compatible with doot
Compatibility is based on MAJOR.MINOR and discards PATCH
Raises a VersionMismatchError otherwise if they aren’t compatible
- Parameters:
ver (jgdv.Maybe[str])
source (jgdv.Maybe[str | pathlib.Path])
override (jgdv.Maybe[str])
- Return type:
None
- update_aliases(
- *,
- data: dict | jgdv.structs.chainguard.ChainGuard,
Update aliases with a dict-like of loaded mappings
- Parameters:
data (dict | jgdv.structs.chainguard.ChainGuard)
- Return type:
None
- update_global_task_state(
- data: jgdv.structs.chainguard.ChainGuard,
- *,
- source: jgdv.Maybe[str] = None,
Try to Update the shared global state. Will try to get data[doot._interface.GLOBAL_STATE_KEY] data and add it to the global task state
toml in [[state]] segments is merged here
- Parameters:
data (jgdv.structs.chainguard.ChainGuard)
source (jgdv.Maybe[str])
- Return type:
None
- update_import_path(*paths: pathlib.Path) None[source]
Add locations to the python path for task local code importing Modifies the global sys.path
- Parameters:
paths (pathlib.Path)
- Return type:
None
- class doot.control.overlord.OverlordFacade(*args, **kwargs)[source]
Bases:
types.ModuleTypeA Facade for the overlord, to be used as the module class of the root package ‘doot’.
- _overlord: doot.control._interface.Overlord_i