UI Modules

Display Module

User interface rendering management.

class sshmenuc.ui.display.MenuDisplay[source]

Bases: object

Manages menu display and rendering.

clear_screen() None[source]

Clear the terminal screen.

print_breadcrumb(breadcrumb: str) None[source]

Print current navigation path above the table.

Parameters:

breadcrumb – Path string, e.g. “HDP > Prod > Admin”

Print table footer.

print_header(headers: List[str]) None[source]

Print table header.

Parameters:

headers – List of header column names

print_instructions(sync_label: str = '', context_label: str = '') None[source]

Print usage instructions.

Parameters:
  • sync_label – Optional sync status label shown at the end of the line.

  • context_label – Optional active context name (shown when multi-context is active).

print_row(infos: tuple, is_selected: bool, is_host: bool, is_marked: bool = False) None[source]

Print a table row.

Parameters:
  • infos – Tuple of (index, data) for the row

  • is_selected – Whether this row is currently selected

  • is_host – Whether this row represents a host entry

  • is_marked – Whether this row is marked for multi-selection

print_table(data: Dict[str, Any] | List[Any], selected_target: int, marked_indices: set, level: int) None[source]

Print complete table with data.

Parameters:
  • data – Dictionary or list of items to display

  • selected_target – Index of currently selected item

  • marked_indices – Set of indices marked for multi-selection

  • level – Current navigation depth level

Colors Module

Color definitions for the user interface.

class sshmenuc.ui.colors.Colors[source]

Bases: object

Terminal color management class with ANSI escape sequences.

BOLD = '\x1b[1m'
ENDC = '\x1b[0m'
FAIL = '\x1b[91m'
HEADER = '\x1b[95m'
OKBLUE = '\x1b[94m'
OKCYAN = '\x1b[96m'
OKGREEN = '\x1b[92m'
UNDERLINE = '\x1b[4m'
WARNING = '\x1b[93m'
classmethod colorize(text: str, color: str) str[source]

Apply a color to text.

Parameters:
  • text – Text to colorize

  • color – ANSI color code

Returns:

Colored text string

classmethod error(text: str) str[source]
classmethod header(text: str) str[source]
classmethod success(text: str) str[source]
classmethod warning(text: str) str[source]