summaryrefslogtreecommitdiff
path: root/examples/oldconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-02-07 02:30:16 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-02-07 03:55:56 +0100
commitf66cd7155158943987570937be37b09d9ca58028 (patch)
tree463bd909a1b04062e3176d61c866a62cbb400f33 /examples/oldconfig.py
parentbb60c1158e8ab98308962abc14ad52e99f7e7f33 (diff)
Allow "n"/"m"/"y" as aliases for 0/1/2 in set_value()
More experience working with the API convinced me that it's worth it. Gets rid of ugly conversions in the menuconfig.py and oldconfig.py examples, and streamlines some things internally as well. Include two other small fixes as well: - Make warnings generated by Choice.set_value() match those generated by Symbol.set_value(). - Get rid of the input stripping in menuconfig.py. It's not like the interface is usable as-is anyway, and it just complicates the example.
Diffstat (limited to 'examples/oldconfig.py')
-rw-r--r--examples/oldconfig.py8
1 files changed, 1 insertions, 7 deletions
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.