TUI

Textual TUI for Package Maximizer.

class package_maximizer.tui.app.MaximizerApp(**kwargs)[source]

Bases: App

Interactive terminal UI for package maximization.

CSS = '\n    Screen {\n        layout: vertical;\n        background: $surface;\n    }\n    #main {\n        height: 1fr;\n    }\n    #results {\n        height: 1fr;\n    }\n    #log {\n        height: 1fr;\n    }\n    .dark-mode {\n        background: $boost;\n        color: $text;\n    }\n    .dark-mode Screen {\n        background: $boost;\n    }\n    .dark-mode #main {\n        background: $surface;\n    }\n    '

Inline CSS, useful for quick scripts. This is loaded after CSS_PATH, and therefore takes priority in the event of a specificity clash.

__init__(**kwargs)[source]

Create an instance of an app.

Parameters:
  • driver_class – Driver class or None to auto-detect. This will be used by some Textual tools.

  • css_path – Path to CSS or None to use the CSS_PATH class variable. To load multiple CSS files, pass a list of strings or paths which will be loaded in order.

  • watch_css – Reload CSS if the files changed. This is set automatically if you are using textual run with the dev switch.

  • ansi_color – Allow ANSI colors if True, or convert ANSI colors to RGB if False, None to use “ansi” parameter from themes.

Raises:

CssPathError – When the supplied CSS path(s) are an unexpected type.

Return type:

None

property dark_mode: bool
toggle_dark_mode()[source]
Return type:

None

compose()[source]

Yield child widgets for a container.

This method should be implemented in a subclass.

Return type:

Iterable[Widget]

on_button_pressed(event)[source]
Parameters:

event (Pressed)

Return type:

None

action_toggle_dark_mode()[source]

Toggle dark mode via keyboard shortcut (Ctrl+D).

Return type:

None

action_help()[source]

Show help dialog via keyboard shortcut (Ctrl+H).

Return type:

None

action_quit()[source]

Quit the application via keyboard shortcut (Ctrl+Q).

Return type:

None

package_maximizer.tui.app.run_tui()[source]

Run the Textual TUI.

Return type:

None