diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/menuconfig.py | 14 | ||||
| -rw-r--r-- | examples/oldconfig.py | 8 |
2 files changed, 2 insertions, 20 deletions
diff --git a/examples/menuconfig.py b/examples/menuconfig.py index b55af6d..753ac40 100644 --- a/examples/menuconfig.py +++ b/examples/menuconfig.py @@ -258,19 +258,7 @@ def get_value_from_user(sc): .format(", ".join([TRI_TO_STR[val] for val in sc.assignable])) prompt += ": " - val_str = input(prompt).strip() - if sc.type in (BOOL, TRISTATE): - if val_str not in STR_TO_TRI: - print("'{}' is not a valid tristate value".format(val_str)) - return False - - # I was thinking of having set_value() accept "n", "m", "y" as well as - # a convenience for BOOL / TRISTATE symbols. Consistently using 0, 1, 2 - # makes the format clearer though. That's the best format in all ways - # except for readability (where it isn't horrible either). - val = STR_TO_TRI[val_str] - else: - val = val_str + val = input(prompt) # Automatically add a "0x" prefix for hex symbols, like the menuconfig # interface does. This isn't done when loading .config files, hence why diff --git a/examples/oldconfig.py b/examples/oldconfig.py index 3550cec..aa8e253 100644 --- a/examples/oldconfig.py +++ b/examples/oldconfig.py @@ -98,7 +98,7 @@ # $ python oldconfig.py Kconfig # Everything's already up to date # Configuration written to .config from __future__ import print_function -from kconfiglib import Kconfig, Symbol, Choice, BOOL, TRISTATE, HEX, STR_TO_TRI +from kconfiglib import Kconfig, Symbol, Choice, BOOL, TRISTATE, HEX import os import sys @@ -202,12 +202,6 @@ def do_oldconfig_for_node(node): if not val: val = sym.str_value - if sym.type in (BOOL, TRISTATE): - if val not in STR_TO_TRI: - eprint("Invalid tristate value") - continue - val = STR_TO_TRI[val] - # Automatically add a "0x" prefix for hex symbols, like the # menuconfig interface does. This isn't done when loading .config # files, hence why set_value() doesn't do it automatically. |
