task
dev_tool.commands.task
log = logging.getLogger(__name__)
module-attribute
TaskCommandGroup
Bases: CommandGroup
A command group for task management operations.
This class provides commands for viewing and managing background tasks, including viewing recent tasks and clearing completed tasks.
The constructor for the TaskCommandGroup class.
This method initializes the command group with the terminal interface and task manager.
Parameters:
-
terminal(Terminal | None, default:None) –The blessed Terminal instance for display operations.
Source code in dev_tool/commands/task.py
interface = BaseInterface(terminal or Terminal())
instance-attribute
task_manager = TaskManager()
instance-attribute
__str__
The string representation of the command group.
This method returns the category name for the command group.
Returns:
-
str–The category name as a string.
view_recent_tasks
A command that opens a submenu for viewing recent tasks.
This method returns a menu displaying the most recent tasks with their status and allows viewing individual task results.
Returns:
-
Menu–A submenu for viewing recent tasks.
Source code in dev_tool/commands/task.py
clear_completed_tasks
A command that clears all completed and failed tasks.
This method removes all tasks that have finished processing, including both successfully completed and failed tasks.