transport_data.cli.interactive.View

class transport_data.cli.interactive.View(app)[source]

Bases: ABC

Representation of a Editor view.

__init__(app) None

Create and display the view.

Subclasses may override this method, but must call super().__init__(app).

Methods

__init__(app)

Create and display the view.

accept(text)

Handle user input.

Attributes

default

Default input.

app

Reference to the Editor.

current

Reference to the EditorState.

text

Text to be displayed in the output text area.

prompt

Prompt text to be displayed in the input text area.

abstractmethod accept(text: str) type[View] | None

Handle user input.

Subclasses must implement this method. An implementation may return a View subclass (not instance) to indicate the next View to be displayed; if it returns None, then NEXT_VIEW is used to identify the next View.

app: Editor

Reference to the Editor.

current: EditorState

Reference to the EditorState.

default: str = ''

Default input.

prompt: str

Prompt text to be displayed in the input text area.

text: str

Text to be displayed in the output text area.