Compare commits
No commits in common. "648d5c956e1f5cd78394fb23a6116bae7e5b9cd6" and "9fe596bc0126d5769fb3f85cd306db68beeb782c" have entirely different histories.
648d5c956e
...
9fe596bc01
|
@ -99,10 +99,10 @@ class CliMenu:
|
||||||
|
|
||||||
if options:
|
if options:
|
||||||
for option in options:
|
for option in options:
|
||||||
if isinstance(option, tuple) and len(option) == 2:
|
if isinstance(option, tuple):
|
||||||
self.add_option(*option)
|
self.add_option(*option)
|
||||||
else:
|
else:
|
||||||
self.add_option(option, option)
|
self.add_option(option)
|
||||||
|
|
||||||
def add_header(self, title, indent=True):
|
def add_header(self, title, indent=True):
|
||||||
for text in title.split('\n'):
|
for text in title.split('\n'):
|
||||||
|
@ -120,11 +120,11 @@ class CliMenu:
|
||||||
return self._success
|
return self._success
|
||||||
|
|
||||||
def get_options(self):
|
def get_options(self):
|
||||||
return [_item for _item in self._items if isinstance(_item, CliMenuOption)]
|
return self._items
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def num_options(self):
|
def num_options(self):
|
||||||
return self._item_num
|
return len(self._items)
|
||||||
|
|
||||||
def get_selection(self):
|
def get_selection(self):
|
||||||
if self.success:
|
if self.success:
|
||||||
|
|
Loading…
Reference in New Issue