urwid

Some handy Urwid utilities.

Take care only to import this where we already have a dependency on Urwid, e.g. in the browser implementation modules.

Some of these are taken pretty exactly from Urwid examples.

Todo

Not got these things working yet, but they’ll be useful in the long run

exception DialogExit[source]

Bases: Exception

class DialogDisplay(original_widget, text, height=0, width=0, body=None)[source]

Bases: urwid.wimp.PopUpLauncher

palette = [('body', 'black', 'light gray', 'standout'), ('border', 'black', 'dark blue'), ('shadow', 'white', 'black'), ('selectable', 'black', 'dark cyan'), ('focus', 'white', 'dark blue', 'bold'), ('focustext', 'light gray', 'dark blue')]
add_buttons(buttons)[source]
button_press(button)[source]
on_exit(exitcode)[source]
class ListDialogDisplay(original_widget, text, height, width, constr, items, has_default)[source]

Bases: pimlico.utils.urwid.DialogDisplay

unhandled_key(size, k)[source]
on_exit(exitcode)[source]

Print the tag of the item selected.

msgbox(original_widget, text, height=0, width=0)[source]
options_dialog(original_widget, text, options, height=0, width=0, *items)[source]
yesno_dialog(original_widget, text, height=0, width=0, *items)[source]