repype.textual.run

class repype.textual.run.RunScreen(contexts: Iterable[RunContext])

Bases: ModalScreen[int]

Screen that performs a batch run of tasks, displaying the progress.

Parameters:

contexts – The contexts of the tasks to run.

BINDINGS: ClassVar[list[BindingType]] = [Binding(key='ctrl+c', action='cancel', description='Cancel', show=True, key_display=None, priority=True), Binding(key='escape', action='close', description='Close', show=True, key_display=None, priority=False)]

Key bindings of the screen.

action_cancel() None

Cancel the batch run.

A confirmation dialog based on confirm() is shown before cancellation.

action_close() None

Close the screen, if no tasks are running.

If tasks are running, an error message is shown.

Dismisses the screen with the number of successfully completed tasks.

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.

contexts: list[RunContext]

The contexts of the tasks to run.

current_task_path: Path | None

The path of the current task being processed, or None if no task is being processed.

custom_format(positions: List[int], status: str | dict | None, intermediate: bool) str

Format a custom status update as a string.

finished_tasks: set[str]

The set of finished tasks (represented by their resolved task paths).

handle_new_status(positions: List[int], status: str | dict | None, intermediate: bool) None

Process a new status update.

The arguments are the same as those of the handle_new_status() method of the repype.status.StatusReader class.

on_mount() None

Update the UI components of a task and run the batch.

run_batch() None

Run the batch of tasks.

success_count: int

The number of successfully completed tasks.

task_id(task_path: PathLike) str

Get a unique alphanumeric identifier of a task.

task_ui(task_path: PathLike) TaskUI

Get the UI components of a task.

update_task_ui(task_path: PathLike) None

Update the UI components of a task.

class repype.textual.run.StatusReaderAdapter(filepath: PathLike, screen: RunScreen)

Bases: StatusReader

handle_new_status(*args, **kwargs)

Delegates the handling of new status updates to the screen.handle_new_status method.

screen: RunScreen

The screen to which the status updates are delegated.

Parameters:
  • filepath – The path to the status file.

  • screen – The screen to which the status updates are delegated.

class repype.textual.run.TaskUI(collapsible: Collapsible)

Bases: object

Widgets of a task.

Parameters:

collapsible – The collapsible widget of the task.

collapsible: Collapsible

The collapsible widget of the task.

property container: Vertical

Container for permanent status updates.

property intermediate: Vertical

Container with widgets for intermediate status updates.

Contains the intermediate_label and intermediate_progressbar widgets.

property intermediate_label: Label

Label for intermediate status updates.

property intermediate_progressbar: ProgressBar

Progress bar for intermediate status updates.