upsies.uis.tui.jobwidgets.base

Classes

class upsies.uis.tui.jobwidgets.base.JobWidgetBase(job, app)[source]

Bases: ABC

User-interaction and information display for JobBase instance

property job

Underlying JobBase instance

abstractmethod setup()[source]

Called on object creation

Create widgets and register job callbacks.

abstract property runtime_widget

Interactive or status widget that is displayed while this job is running

Returns:

Window object or None

property output_widget

Job output

Returns:

Window object

property info_widget

info that is only displayed while this job is running

Returns:

Window object

property warnings_widget

Any warnings

Returns:

Window object

property errors_widget

Any errors

Returns:

Window object

property is_interactive

Whether this job may require user interaction at any point

Subclasses should hardcode this as a class attribute to True or False. The default implementation tries to guess interactivity by finding a focusable widget. This is expensive and can be inaccurate because widgets come and go.

property keybindings_global

Application-wide prompt_toolkit.key_binding.KeyBindings instance

These keybindings are always active as long as the TUI is running, regardless of which widget is focused. This also makes it possible to bind keys for unfocusable wigets.

To keep things tidy and intuitive, all keybindings should be sequences of multiple keys. The first key should always start with c-<x> where c stands for Control and <x> is a character that is associated with the job’s label.

For example, CreateTorrentJob keybindings start with c-t and SceneCheckJob keybindings start with c-s.

property keybindings_local

Widget-wide prompt_toolkit.key_binding.KeyBindings instance

These keybindings are only active as long as this widget is focused. If there are conflicts, local keybindings take precedence over global keybindings.

invalidate()[source]

Schedule redrawing of the TUI