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 4 years ago
parent 9fe596bc01
commit 8c6ee790bf

@ -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