Browse Source

Fix get_options() and num_options to work on options

get_options() and num_options used to work on all menu items, including
blank spaces and headers. Now these work only on options, as they were
originally intended
master
Sebastian Lohff 3 years ago
parent
commit
8c6ee790bf
  1. 4
      clintermission/climenu.py

4
clintermission/climenu.py

@ -120,11 +120,11 @@ class CliMenu: @@ -120,11 +120,11 @@ class CliMenu:
return self._success
def get_options(self):
return self._items
return [_item for _item in self._items if isinstance(_item, CliMenuOption)]
@property
def num_options(self):
return len(self._items)
return self._item_num
def get_selection(self):
if self.success:

Loading…
Cancel
Save