textual_wrapper.types

Base classes for the wrapper.

Classes:

MenuOption(label, keypress)

An option in the menubar or the right click menu of the launcher/taskbar icon.

Wrapper(name, arguments[, icon, ...])

A wrapper around a terminal app.

namedtuple MenuOption(label, keypress)[source]

Bases: NamedTuple

An option in the menubar or the right click menu of the launcher/taskbar icon.

Fields
  1.  label (str) – Label for the option.

  2.  keypress (str) – The keypress(es) to send to the terminal app.

__repr__()

Return a nicely formatted representation string

class Wrapper(name, arguments, icon=None, launcher_options=<factory>, menu_options=<factory>)[source]

Bases: ABC

A wrapper around a terminal app.

Methods:

__eq__(other)

Return self==value.

__repr__()

Return repr(self).

add_launcher_option(option)

Add an option to the launcher/taskbar icon.

add_menu_option(option[, group])

Add an option to the menubar at the top of the window.

run([working_directory])

Launch the wrapper.

Attributes:

arguments

The executable and command line arguments.

icon

Optional icon filename.

launcher_options

List of right click options for the launcher/taskbar icon.

menu_options

Options for the menubar.

name

The name of the application.

__eq__(other)

Return self==value.

__repr__()

Return repr(self).

add_launcher_option(option)[source]

Add an option to the launcher/taskbar icon.

Parameters

option (MenuOption)

add_menu_option(option, group='File')[source]

Add an option to the menubar at the top of the window.

Parameters
  • option (MenuOption)

  • group (str) – The top level button, e.g. File, Edit, Help. Default 'File'.

arguments

Type:    list[str]

The executable and command line arguments.

icon: typing.Optional[str] = None

Optional icon filename.

launcher_options

Type:    list[MenuOption]

List of right click options for the launcher/taskbar icon.

menu_options

Type:    dict[str, list[MenuOption]]

Options for the menubar.

name

Type:    str

The name of the application.

abstract run(working_directory=None)[source]

Launch the wrapper.

Parameters

working_directory (Union[str, Path, PathLike, None]) – Directory to execute the application in. Default None.