views
dev_tool.tui.views
ViewManager
A manager class for handling view switching and delegation.
This class centralizes view management, reducing controller complexity.
The constructor for the ViewManager class.
Parameters:
-
terminal(Terminal) –The blessed Terminal instance.
-
ui(UserInterface) –The user interface instance.
Source code in dev_tool/tui/views.py
current = ViewType.MAIN_MENU
instance-attribute
display_content = None
instance-attribute
display_interface = DisplayInterface(terminal)
instance-attribute
help_interface = HelpInterface(terminal)
instance-attribute
task_interface = TaskInterface(terminal)
instance-attribute
terminal = terminal
instance-attribute
ui = ui
instance-attribute
draw
A method that draws the current view.
Source code in dev_tool/tui/views.py
handle_input
A method that delegates input handling to the current view.
Parameters:
-
key(str) –The key name.
Returns:
-
str | None–The action result or None to continue.
Source code in dev_tool/tui/views.py
needs_redraw
A method that checks if the current view needs redrawing.
Returns:
-
bool–True if redraw needed, False otherwise.
Source code in dev_tool/tui/views.py
set_display_content
A method that sets display content and switches to display view.
Parameters:
-
content(str) –The content to display.
Source code in dev_tool/tui/views.py
switch_to
A method that switches to a different view.
Parameters:
-
view(ViewType) –The view type to switch to.