action
dev_tool.tui.menu.action
log = logging.getLogger(__name__)
module-attribute
Action
Bases: Protocol
A protocol for menu actions.
This class defines the interface for executing actions in the TUI menu.
run
is_submenu
A method that checks if this action is a submenu action.
Returns:
-
bool–True if this is a submenu action, False otherwise.
get_action_type
CommandAction
dataclass
A class for executing commands from the TUI menu.
This class runs a command function when selected from the menu.
command
instance-attribute
run
A method that stores the command for execution after exiting cbreak mode.
Parameters:
-
controller(MenuController) –The menu controller.
is_submenu
A method that checks if this action is a submenu action.
Returns:
-
bool–True if this is a submenu action, False otherwise.
get_action_type
DisplayAction
dataclass
A class for displaying scrollable content in the TUI.
This class displays content within the TUI loop without exiting cbreak mode, allowing for scrolling and navigation back to the menu.
content
instance-attribute
run
A method that displays the content in the TUI display view.
Parameters:
-
controller(MenuController) –The menu controller.
is_submenu
A method that checks if this action is a submenu action.
Returns:
-
bool–True if this is a submenu action, False otherwise.
get_action_type
SubmenuAction
dataclass
A class for opening submenus from the TUI menu.
This class navigates to a submenu when selected from the menu.
submenu
instance-attribute
run
A method that opens the submenu.
Parameters:
-
controller(MenuController) –The menu controller.
Source code in dev_tool/tui/menu/action.py
is_submenu
A method that checks if this action is a submenu action.
Returns:
-
bool–True if this is a submenu action, False otherwise.