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
Sebastian Lohff 2 months ago
parent
commit
8c6ee790bf
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      clintermission/climenu.py

+ 2
- 2
clintermission/climenu.py View File

@@ -120,11 +120,11 @@ class CliMenu:
120 120
         return self._success
121 121
 
122 122
     def get_options(self):
123
-        return self._items
123
+        return [_item for _item in self._items if isinstance(_item, CliMenuOption)]
124 124
 
125 125
     @property
126 126
     def num_options(self):
127
-        return len(self._items)
127
+        return self._item_num
128 128
 
129 129
     def get_selection(self):
130 130
         if self.success:

Loading…
Cancel
Save