menus.esc module

Provides ESC Menu functionality.

Bases: menus.esc.PagedESCMenu

Creates a list-like ESC menu.

Navigation options are added automatically.

Initialize the object.

Parameters:

Bases: menus.esc.PagedESCOption

Provides options for ListESCMenu objects.

Initialize the option.

Parameters:
  • text (str) – See menus.base._BaseOption.__init__().
  • hightlight (bool) – See SimpleESCMenu.__init__().
  • enumerated (bool) – If True the number of the option will be added in front of the text.

Bases: menus.esc.SimpleESCMenu, menus.base._PagedMenuBase

Create menus with an unlimited number of options.

Navigation options will be added automatically.

Initialize the object.

Parameters:
  • data (iterable|None) – See menus.base._BaseMenu.__init__().
  • select_callback (callable|None) – See menus.base._BaseMenu.__init__().
  • build_callback (callable|None) – See menus.base._BaseMenu.__init__().
  • close_callback (callable|None) – See menus.base._BaseMenu.__init__().
  • description (str|None) – See SimpleESCMenu.__init__().
  • title (str|None) – See SimpleESCMenu.__init__().
  • title_color (Color) – See SimpleESCMenu.__init__().
  • fill (bool) – If True the menu will always have the same size by filling unused options.
  • parent_menu (_BaseMenu) – A menu that will be displayed when hitting ‘Back’ on the first page.

Bases: menus.base._BaseOption

Display an enumerated option.

Bases: menus.base._BaseMenu

This class creates basic ESC menus.

Initialize the object.

Parameters:
  • data (iterable|None) – See menus.base._BaseMenu.__init__().
  • select_callback (callable|None) – See menus.base._BaseMenu.__init__().
  • build_callback (callable|None) – See menus.base._BaseMenu.__init__().
  • close_callback (callable|None) – See menus.base._BaseMenu.__init__()
  • description (str|None) – A description that is displayed under the title.
  • title (str|None) – A title that is displayed at the top of the menu.
  • title_color (Color) – The color of the title.

Bases: menus.base._BaseOption

Provides options for SimpleESCMenu objects.

Initialize the option.

Parameters:
  • choice_index (int) – The number that is required to select the option.
  • text (str) – See menus.base._BaseOption.__init__().
  • value – See menus.base._BaseOption.__init__().
  • hightlight (bool) – Does not work with ESC menus.
  • selectable (bool) – Does not work with ESC menus.