sshmitm.moduleparser.pluginbrowser.app module

Plugin Browser Textual application.

class sshmitm.moduleparser.pluginbrowser.app.PluginBrowserApp(parser, config)

Bases: App[None]

Plugin Browser

Parameters:
BINDINGS = [Binding(key='q', action='quit', description='Quit', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key='a', action='focus_args', description='Arguments', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key='escape', action='focus_tree', description='Plugins', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key='[', action='shrink_desc', description='< Desc', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key=']', action='grow_desc', description='Desc >', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None)]

The default key bindings.

CSS = '#main-tabs {\n    height: 1fr;\n}\n\n#tab-browser {\n    padding: 0;\n    height: 1fr;\n}\n\n#tab-overview {\n    padding: 0;\n    height: 1fr;\n}\n\n#overview-layout {\n    height: 1fr;\n}\n\n#filter-bar {\n    height: 3;\n    margin: 1 1 0 1;\n}\n\n#filter-input {\n    width: 1fr;\n}\n\n#status-filter {\n    width: 22;\n}\n\n#all-plugins-table {\n    height: 1fr;\n    margin: 0 1 1 1;\n}\n\n#main {\n    height: 1fr;\n}\n\n#sidebar {\n    width: 30;\n    min-width: 22;\n    border-right: solid $primary-darken-2;\n    background: $surface;\n}\n\n#plugin-tree {\n    height: 1fr;\n    scrollbar-size: 1 1;\n}\n\n#detail {\n    width: 1fr;\n    height: 1fr;\n    background: $panel;\n    layout: vertical;\n}\n\n#placeholder {\n    height: auto;\n    padding: 2;\n    color: $text-muted;\n}\n\n#plugin-view {\n    height: 1fr;\n}\n\n#top-section {\n    height: 20;\n    border-bottom: solid $primary-darken-2;\n}\n\n#sec-info {\n    height: auto;\n    padding: 1 2 0 2;\n}\n\n#sec-doc {\n    height: auto;\n    padding: 0 2 1 2;\n}\n\n#tabs {\n    height: 1fr;\n}\n\n#args-split {\n    height: 1fr;\n}\n\n#groups-sidebar {\n    width: 35;\n    min-width: 22;\n    border-right: solid $primary-darken-2;\n    background: $surface;\n}\n\n#groups-tree {\n    height: 1fr;\n    scrollbar-size: 1 1;\n}\n\n#cli-scroll {\n    width: 1fr;\n    height: 1fr;\n    padding: 1 2;\n}\n\n#cfg-scroll {\n    width: 1fr;\n    height: 1fr;\n}\n\n#cfg-header {\n    height: auto;\n    padding: 1 2 0 2;\n}\n\n#tbl-config {\n    height: auto;\n    margin: 1 2;\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__(parser, config)

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.

  • parser (ModuleParser)

  • config (BrowserConfig)

Raises:

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

action_focus_args()
Return type:

None

action_focus_tree()
Return type:

None

action_grow_desc()
Return type:

None

action_shrink_desc()
Return type:

None

compose()

Yield child widgets for a container.

This method should be implemented in a subclass.

Return type:

Iterable[Widget]

on_input_changed(event)
Parameters:

event (Changed)

Return type:

None

on_mount()
Return type:

None

on_select_changed(event)
Parameters:

event (Changed)

Return type:

None

async on_tree_node_selected(event)
Parameters:

event (NodeSelected[Any])

Return type:

None

sshmitm.moduleparser.pluginbrowser.app.run_browser(parser)

Launch the plugin browser TUI.

Parameters:

parser (ModuleParser)

Return type:

None