improv.tui
#
Module Contents#
Classes#
A widget for logging text. |
|
A widget for the root of the app. |
|
A widget for the root of the app. |
|
View class for the text user interface. Implemented as a Textual app. |
Attributes#
- improv.tui.logger#
- class improv.tui.SocketLog(port, context, *args, **kwargs)[source]#
Bases:
textual.widgets.TextLog
A widget for logging text.
- write(content, width=None, expand=False, shrink=True)[source]#
Write text or a rich renderable.
- Parameters:
content – Rich renderable (or text).
width – Width to render or
None
to use optimal width.expand – Enable expand to widget width, or
False
to use width.shrink – Enable shrinking of content to fit width.
- class improv.tui.QuitScreen(name: str | None = None, id: str | None = None, classes: str | None = None)[source]#
Bases:
textual.screen.Screen
A widget for the root of the app.
- class improv.tui.HelpScreen(name: str | None = None, id: str | None = None, classes: str | None = None)[source]#
Bases:
textual.screen.Screen
A widget for the root of the app.
- class improv.tui.TUI(control_port, output_port, logging_port)[source]#
Bases:
textual.app.App
View class for the text user interface. Implemented as a Textual app.
- CSS_PATH = 'tui.css'#
- BINDINGS = [('tab', 'focus_next', 'Focus Next'), ('ctrl+c', 'request_quit', 'Emergency Quit'), ('ctrl+p',...#
- async send_to_controller(msg)[source]#
Safe version of send/receive with controller. Based on the Lazy Pirate pattern [here] (https://zguide.zeromq.org/docs/chapter4/#Client-Side-Reliability-Lazy-Pirate-Pattern)
- improv.tui.CONTROL_PORT = '5555'#