repype.textual.batch

class repype.textual.batch.BatchScreen

Bases: Screen

App screen for managing tasks.

BINDINGS: ClassVar[list[BindingType]] = [Binding(key='a', action='add_task', description='Add sub-task', show=True, key_display=None, priority=False), Binding(key='e', action='edit_task', description='Edit task', show=True, key_display=None, priority=False), Binding(key='d', action='delete_task', description='Delete task', show=True, key_display=None, priority=False), Binding(key='r', action='run_tasks', description='Run tasks', show=True, key_display=None, priority=False), Binding(key='R', action='reset_task', description='Reset task', show=True, key_display=None, priority=False), Binding(key='x', action='toggle_task', description='Toggle task', show=True, key_display=None, priority=False)]

Key bindings of the screen.

action_add_task() None

Create a sub-task for the selected task using an editor of the editor_screen_cls type.

Does nothing if no task is selected.

action_delete_task() None

Delete the selected task and all sub-tasks.

A confirmation dialog based on confirm() is shown before resetting the task.

Does nothing if no task is selected.

action_edit_task() None

Edit the selected task using an editor of the editor_screen_cls type.

Does nothing if no task is selected.

action_reset_task() None

Reset the selected task.

A confirmation dialog based on confirm() is shown before resetting the task.

Does nothing if no task is selected.

action_run_tasks() None

Run the queued tasks.

An instance of the run_screen_cls is pushed to the screen stack for running the tasks.

If no tasks are queued and the selected task is not pending, an error is shown. Does nothing if no tasks are queued and no task is selected.

async action_toggle_task() None

Toggle the selected task (queued or not queued).

Does nothing if the task is not pending.

can_focus: bool = False

Widget may receive focus.

can_focus_children: bool = True

Widget’s children may receive focus.

compose() Iterator[Widget]

Compose the screen.

Yields:

The components of the screen.

async confirm(*args, **kwargs) bool

Shortcut for repype.textual.confirm.confirm.

editor_screen_cls

The editor screen class.

The return value of the editor screen is used to determine if the task tree should be updated. It should be True if changes were saved or tasks were created, and False otherwise.

alias of EditorScreen

format_task_label(task: Task) str

Format the label of a task from the batch for display in the task tree.

property non_pending_tasks: Iterator[Task]

Yields the non-pending tasks of the batch (i.e. completed and the non-runnable tasks).

on_mount() None

Expands the root task nodes and loads the task tree.

queued_tasks: list[Task]

The tasks that are queued for running.

run_screen_cls

The run screen class.

The return value of the run screen should be the number of successfully completed tasks.

alias of RunScreen

update_summary() None

Update the batch summary.

update_task_tree() None

Reload the task tree.

repype.textual.batch.find_root_tasks(batch: Batch) Iterator[Task]

Find all root tasks of the batch.

Yields:

The root tasks of the batch.

repype.textual.batch.find_sub_tasks(batch: Batch) Iterator[Task]

Find all non-root tasks of the batch.

Yields:

The non-root tasks of the batch.