parent
d33b407ba8
commit
27cda8bf08
|
@ -27,7 +27,7 @@ def _print_setting(s, verbose=True):
|
||||||
if s.description:
|
if s.description:
|
||||||
print('#', s.description.replace('\n', ' '))
|
print('#', s.description.replace('\n', ' '))
|
||||||
if s.kind == _settings.KIND.toggle:
|
if s.kind == _settings.KIND.toggle:
|
||||||
print('# possible values: on/true/t/yes/y/1 or off/false/f/no/n/0')
|
print('# possible values: on/true/t/yes/y/1 or off/false/f/no/n/0 or Toggle')
|
||||||
elif s.kind == _settings.KIND.choice:
|
elif s.kind == _settings.KIND.choice:
|
||||||
print(
|
print(
|
||||||
'# possible values: one of [', ', '.join(str(v) for v in s.choices),
|
'# possible values: one of [', ', '.join(str(v) for v in s.choices),
|
||||||
|
@ -82,6 +82,9 @@ def select_choice(value, choices, setting, key):
|
||||||
|
|
||||||
|
|
||||||
def select_toggle(value, setting):
|
def select_toggle(value, setting):
|
||||||
|
if value == 'Toggle':
|
||||||
|
value = not setting.read()
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
value = bool(int(value))
|
value = bool(int(value))
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Loading…
Reference in New Issue