simple_term_menu_vendor.simple_term_menu module

class simple_term_menu_vendor.simple_term_menu.AttributeDict

Bases: dict

class simple_term_menu_vendor.simple_term_menu.BoxDrawingCharacters

Bases: object

horizontal = '─'
lower_left = '└'
lower_right = '┘'
upper_left = '┌'
upper_right = '┐'
vertical = '│'
exception simple_term_menu_vendor.simple_term_menu.InvalidParameterCombinationError

Bases: Exception

exception simple_term_menu_vendor.simple_term_menu.InvalidStyleError

Bases: Exception

exception simple_term_menu_vendor.simple_term_menu.NoMenuEntriesError

Bases: Exception

exception simple_term_menu_vendor.simple_term_menu.PreviewCommandFailedError

Bases: Exception

class simple_term_menu_vendor.simple_term_menu.TerminalMenu(menu_entries: Iterable[str], *, accept_keys: Iterable[str] = ('enter',), clear_menu_on_exit: bool = True, clear_screen: bool = False, cursor_index: int | None = None, cycle_cursor: bool = True, exit_on_shortcut: bool = True, menu_cursor: str | None = '> ', menu_cursor_style: Iterable[str] | None = ('fg_red', 'bold'), menu_highlight_style: Iterable[str] | None = ('standout',), multi_select: bool = False, multi_select_cursor: str = '[*] ', multi_select_cursor_brackets_style: Iterable[str] | None = ('fg_gray',), multi_select_cursor_style: Iterable[str] | None = ('fg_yellow', 'bold'), multi_select_empty_ok: bool = False, multi_select_keys: Iterable[str] | None = (' ', 'tab'), multi_select_select_on_accept: bool = True, preselected_entries: Iterable[str | int] | None = None, preview_border: bool = True, preview_command: str | Callable[[str], str] | None = None, preview_size: float = 0.25, preview_title: str = 'preview', quit_keys: Iterable[str] = ('escape', 'q', 'ctrl-g'), raise_error_on_interrupt: bool = False, search_case_sensitive: bool = False, search_highlight_style: Iterable[str] | None = ('fg_black', 'bg_yellow', 'bold'), search_key: str | None = '/', shortcut_brackets_highlight_style: Iterable[str] | None = ('fg_gray',), shortcut_key_highlight_style: Iterable[str] | None = ('fg_blue',), show_multi_select_hint: bool = False, show_multi_select_hint_text: str | None = None, show_search_hint: bool = False, show_search_hint_text: str | None = None, show_shortcut_hints: bool = False, show_shortcut_hints_in_status_bar: bool = True, skip_empty_entries: bool = False, status_bar: str | Iterable[str] | Callable[[str], str] | None = None, status_bar_below_preview: bool = False, status_bar_style: Iterable[str] | None = ('fg_yellow', 'bg_black'), title: str | Iterable[str] | None = None)

Bases: object

class Search(menu_entries: Iterable[str], search_text: str | None = None, case_senitive: bool = False, show_search_hint: bool = False)

Bases: object

property change_callback: Callable[[], None] | None
property matches: List[Tuple[int, Match[str]]]
property occupied_lines_count: int
property search_regex: Pattern[str] | None
property search_text: str | None
class Selection(num_menu_entries: int, preselected_indices: Iterable[int] | None = None)

Bases: object

add(menu_index: int) None
clear() None
remove(menu_index: int) None
property selected_menu_indices: Tuple[int, ...]
toggle(menu_index: int) bool
class View(menu_entries: Iterable[str], search: Search, selection: Selection, viewport: Viewport, cycle_cursor: bool = True, skip_indices: List[int] = [])

Bases: object

property active_displayed_index: int | None
property active_menu_index: int | None
convert_displayed_index_to_menu_index(displayed_index: int) int
convert_menu_index_to_displayed_index(menu_index: int) int | None
decrement_active_index() None
property displayed_selected_indices: List[int]
increment_active_index() None
is_visible(menu_index: int) bool
property max_displayed_index: int
update_view() None
class Viewport(num_menu_entries: int, title_lines_count: int, status_bar_lines_count: int, preview_lines_count: int, search_lines_count: int)

Bases: object

keep_visible(cursor_position: int | None, refresh_terminal_size: bool = True) None
property lower_index: int
property must_scroll: bool
property num_menu_entries: int
property preview_lines_count: int
property search_lines_count: int
property size: int
property status_bar_lines_count: int
property title_lines_count: int
update_terminal_size() None
property upper_index: int
property viewport: Tuple[int, int]
property chosen_accept_key: str | None
property chosen_menu_entries: Tuple[str, ...] | None
property chosen_menu_entry: str | None
property chosen_menu_index: int | None
property chosen_menu_indices: Tuple[int, ...] | None
show() int | Tuple[int, ...] | None
exception simple_term_menu_vendor.simple_term_menu.UnknownMenuEntryError

Bases: Exception

simple_term_menu_vendor.simple_term_menu.get_argumentparser() ArgumentParser
simple_term_menu_vendor.simple_term_menu.get_locale() str
simple_term_menu_vendor.simple_term_menu.main() None
simple_term_menu_vendor.simple_term_menu.parse_arguments() AttributeDict
simple_term_menu_vendor.simple_term_menu.static_variables(**variables: Any) Callable[[Callable[[...], Any]], Callable[[...], Any]]
simple_term_menu_vendor.simple_term_menu.wcswidth(text: str) int