devctrl.gui.app.task_host.TaskHost#
- class TaskHost[source]#
Bases:
objectHolds the shared task manager and helper state.
The widget is created lazily so it is available even when no module uses the task system heavily; the host keeps a reference for the console/plugins.
Methods
Create the single global
TaskManagerWidgetif not present.Return the shared task manager, creating it lazily if needed.
- __annotations__ = {}#
- __dict__ = mappingproxy({'__module__': 'devctrl.gui.app.task_host', '__firstlineno__': 21, '__doc__': 'Holds the shared task manager and helper state.\n\nThe widget is created lazily so it is available even when no module uses the\ntask system heavily; the host keeps a reference for the console/plugins.\n', '__init__': <function TaskHost.__init__>, 'get_manager': <function TaskHost.get_manager>, 'ensure_manager': <function TaskHost.ensure_manager>, '__static_attributes__': ('_manager', '_preset_manager', 'task_directory_changed', 'tasklist_directory_changed'), '__dict__': <attribute '__dict__' of 'TaskHost' objects>, '__weakref__': <attribute '__weakref__' of 'TaskHost' objects>, '__annotations__': {'_manager': 'devtask.TaskManagerWidget | None', '_preset_manager': 'devtask.TaskPresetManager | None'}})#
- __firstlineno__ = 21#
- __module__ = 'devctrl.gui.app.task_host'#
- __static_attributes__ = ('_manager', '_preset_manager', 'task_directory_changed', 'tasklist_directory_changed')#
- __weakref__#
list of weak references to the object
- ensure_manager(preset_manager: TaskPresetManager | None = None, initial_task_directory: str | None = None, initial_tasklist_directory: str | None = None, tasklist_path: str | None = None) TaskManagerWidget[source]#
Create the single global
TaskManagerWidgetif not present.If the manager already exists, the preset manager and directory arguments are applied to it, so a module can (re-)configure the manager even when the host or another module has already created it. A call without arguments never modifies the existing configuration.
If the manager does not exist yet, missing arguments are replaced by sensible defaults below the host cache directory, so the task system works even before a module supplies its own config paths.
- Parameters:
preset_manager – A
TaskPresetManager, or None to create one in the default preset directory.initial_task_directory – Initial “load task settings” directory.
initial_tasklist_directory – Initial “load tasklist” directory.
tasklist_path – Path to load the task list from on creation (
Noneskips). Ignored when the manager already exists.
- Returns:
The shared
TaskManagerWidget.
- get_manager() TaskManagerWidget[source]#
Return the shared task manager, creating it lazily if needed.
- Raises:
RuntimeError – If the manager could not be created (usually only when called before
ensure_manager()provided the required dirs).