yera.runtime.handlers.tree_selector.ansi

Collect tree selections through an interactive ANSI browser.

Symbols

class ANSITreeSelectorHandler — Render a keyboard-driven tree and submit its selected leaf values.

ANSITreeSelectorHandler

Inherits: BaseHandler

Render a keyboard-driven tree and submit its selected leaf values.

The browser validates the configured selection limits. Activating a configured cancellation action submits a correlated cancelled response without requiring a selected leaf.

Methods

__init__ — Initialize the tree selector with its interactive terminal console.
push — Display the tree and submit the selected leaf values.

ANSITreeSelectorHandler.__init__

__init__(
    console: Console,
) → None

Initialize the tree selector with its interactive terminal console.

Parameters

console
type: Console

Rich console used to present the selector and validation.

ANSITreeSelectorHandler.push

push(
    event: OutputEvent,
) → None

Display the tree and submit the selected leaf values.

Parameters

event
type: OutputEvent

An output event carrying TreeSelectorData.

Raises

TypeError

If the event data is not TreeSelectorData.