components
dev_tool.tui.components
__all__ = ['HeaderComponent', 'ItemComponent', 'NavigationHandler', 'NotificationComponent', 'StateManager', 'StatusBarComponent', 'TabComponent']
module-attribute
HeaderComponent
A component for rendering the header.
The constructor for the HeaderComponent class.
Parameters:
-
terminal(Terminal) –The blessed Terminal instance.
-
theme(Default) –The theme instance for styling.
Source code in dev_tool/tui/components/header.py
project = CONTEXT.configuration.get_project_name() or 'Unknown'
instance-attribute
terminal = terminal
instance-attribute
theme = theme
instance-attribute
draw
A method that draws the header with the project title.
Parameters:
-
output(list) –The list to append terminal output strings to.
Source code in dev_tool/tui/components/header.py
ItemComponent
A component for rendering the menu items.
The constructor for the ItemComponent class.
Parameters:
-
terminal(Terminal) –The blessed Terminal instance.
-
theme(Default) –The theme instance for styling.
-
state(StateManager) –The state manager instance.
Source code in dev_tool/tui/components/item.py
notification = NotificationDisplay(terminal)
instance-attribute
state = state
instance-attribute
terminal = terminal
instance-attribute
theme = theme
instance-attribute
draw
A method that draws the menu items.
Parameters:
-
output(list) –The list to append terminal output strings to.
Source code in dev_tool/tui/components/item.py
NavigationHandler
A handler class for navigation logic.
The constructor for the NavigationHandler class.
Parameters:
-
state(StateManager) –The state manager instance.
-
notification(NotificationDisplay) –The notification display instance.
Source code in dev_tool/tui/components/navigation.py
notification = notification
instance-attribute
state = state
instance-attribute
get_selected_item
A method that gets the currently selected menu item.
Returns:
-
MenuItem–The selected menu item.
Source code in dev_tool/tui/components/navigation.py
handle_navigation
A method that handles navigation key presses.
Parameters:
-
key(str) –The key name.
Returns:
-
bool–True if the UI needs redraw, False otherwise.
Source code in dev_tool/tui/components/navigation.py
NotificationComponent
A component for rendering notifications.
The constructor for the NotificationComponent class.
Parameters:
-
terminal(Terminal) –The blessed Terminal instance.
Source code in dev_tool/tui/components/notification.py
notification = NotificationDisplay(terminal)
instance-attribute
terminal = terminal
instance-attribute
draw
A method that draws notification banners below the header.
Parameters:
-
output(list) –The list to append terminal output strings to.
Source code in dev_tool/tui/components/notification.py
get_notification_lines
StateManager
A class for managing TUI state and navigation stack.
The constructor for the StateManager class.
Source code in dev_tool/tui/components/state.py
stack = [State(menu=menu, index=0, row=0, offset=0, tab=0)]
instance-attribute
current
property
index
property
writable
menu
property
offset
property
writable
root
property
row
property
writable
tab
property
writable
go_back
is_root_with_tabs
A method that checks if currently at root level with tabs.
Returns:
-
bool–True if at root with tabs, False otherwise.
is_tabs
A method that checks if the current menu has tabs.
Returns:
-
bool–True if the menu has tabs, False otherwise.
Source code in dev_tool/tui/components/state.py
push_menu
A method that pushes a new menu onto the stack.
Parameters:
-
menu(Menu) –The new menu.
Source code in dev_tool/tui/components/state.py
StatusBarComponent
A component for rendering the status bar.
The constructor for the StatusBarComponent class.
Parameters:
-
terminal(Terminal) –The blessed Terminal instance.
-
theme(Default) –The theme instance for styling.
-
state(StateManager) –The state manager instance.
Source code in dev_tool/tui/components/status_bar.py
state = state
instance-attribute
terminal = terminal
instance-attribute
theme = theme
instance-attribute
draw
A method that draws the status bar with navigation info.
Parameters:
-
output(list) –The list to append terminal output strings to.
Source code in dev_tool/tui/components/status_bar.py
TabComponent
A component for rendering the tabs.
The constructor for the TabComponent class.
Parameters:
-
terminal(Terminal) –The blessed Terminal instance.
-
theme(Default) –The theme instance for styling.
-
state(StateManager) –The state manager instance.
Source code in dev_tool/tui/components/tab.py
notification = NotificationDisplay(terminal)
instance-attribute
state = state
instance-attribute
terminal = terminal
instance-attribute
theme = theme
instance-attribute
draw
A method that draws the tab navigation if applicable.
Parameters:
-
output(list) –The list to append terminal output strings to.