Skip to content

Application

Textual application shell composed from consumer-owned pages.

OperatorApp

OperatorApp(spec: OperatorAppSpec)

Bases: App[None]

Reusable application frame: header, tabs, mounted pages, and workbench.

BINDINGS class-attribute

BINDINGS: list[Binding] = [Binding('q', 'quit', 'Quit')]

CSS_PATH class-attribute

CSS_PATH: str = 'themes/groundskeeping.tcss'

jobs instance-attribute

jobs = JobManager(spec.job_policy)

registry instance-attribute

registry = spec.validate()

spec instance-attribute

spec = spec

sub_title instance-attribute

sub_title = spec.subtitle or ''

title instance-attribute

title = spec.title

compose

compose() -> ComposeResult

on_button_pressed

on_button_pressed(event: Pressed) -> None

on_data_table_row_highlighted

on_data_table_row_highlighted(
    event: RowHighlighted,
) -> None

on_data_table_row_selected

on_data_table_row_selected(event: RowSelected) -> None

on_mount

on_mount() -> None

on_option_list_option_selected

on_option_list_option_selected(
    event: OptionSelected,
) -> None

on_tabs_tab_activated

on_tabs_tab_activated(event: TabActivated) -> None

on_tree_node_selected

on_tree_node_selected(
    event: NodeSelected[CatalogueItem],
) -> None

on_workbench_selection_changed

on_workbench_selection_changed(
    event: SelectionChanged,
) -> None

on_workbench_selection_highlighted

on_workbench_selection_highlighted(
    event: SelectionHighlighted,
) -> None

open_wizard

open_wizard(controller: WizardController) -> None

show_page

show_page(page_key: str) -> None

OperatorAppSpec dataclass

OperatorAppSpec(
    app_id: str,
    title: str,
    subtitle: str | None,
    pages: tuple[PageRegistration, ...],
    actions: ActionRegistry = (
        lambda: ActionRegistry(())
    )(),
    operation_policy: OperationPolicy = AllowAllOperationPolicy(),
    job_policy: JobPolicy = SingleForegroundJobPolicy(),
    result_presenter: ResultPresenter = DefaultResultPresenter(),
    workbench_labels: WorkbenchLabels = WorkbenchLabels(),
    default_page: str | None = None,
    metadata: Mapping[str, object] | None = None,
)

Immutable composition root for a Groundskeeping application.

actions class-attribute instance-attribute

actions: ActionRegistry = field(
    default_factory=lambda: ActionRegistry(())
)

app_id instance-attribute

app_id: str

default_page class-attribute instance-attribute

default_page: str | None = None

job_policy class-attribute instance-attribute

job_policy: JobPolicy = field(
    default_factory=SingleForegroundJobPolicy
)

metadata class-attribute instance-attribute

metadata: Mapping[str, object] | None = None

operation_policy class-attribute instance-attribute

operation_policy: OperationPolicy = field(
    default_factory=AllowAllOperationPolicy
)

pages instance-attribute

pages: tuple[PageRegistration, ...]

result_presenter class-attribute instance-attribute

result_presenter: ResultPresenter = field(
    default_factory=DefaultResultPresenter
)

subtitle instance-attribute

subtitle: str | None

title instance-attribute

title: str

workbench_labels class-attribute instance-attribute

workbench_labels: WorkbenchLabels = field(
    default_factory=WorkbenchLabels
)

validate

validate() -> PageRegistry