summaryrefslogtreecommitdiff
path: root/examples/allyesconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-08 07:36:57 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-08 07:37:27 +0100
commit88fc64fbebd2d8344cb8af486e4dc732ed2542df (patch)
treeac4a84445170ed786a145a1445d5fd1253ec699a /examples/allyesconfig.py
parenta21d4585f2299df64cdb60af86c254aa4aa8da72 (diff)
Clarify allno/yesconfig.py.
Diffstat (limited to 'examples/allyesconfig.py')
-rw-r--r--examples/allyesconfig.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/allyesconfig.py b/examples/allyesconfig.py
index 12dc19e..aa1d58b 100644
--- a/examples/allyesconfig.py
+++ b/examples/allyesconfig.py
@@ -23,7 +23,8 @@ conf = kconfiglib.Config(sys.argv[1])
non_choice_syms = [sym for sym in conf.get_symbols() if
not sym.is_choice_item()]
-while True:
+done = False
+while not done:
done = True
# Handle symbols outside of choices
@@ -50,17 +51,15 @@ while True:
selection.set_value("y")
done = False
- # Handle choices whose visibility only allow them to be in "m" mode
+ # Handle choices whose visibility only allow them to be in "m" mode.
+ # This might happen if a choice depends on a symbol that can only be
+ # "m" for example.
elif choice.get_visibility() == "m":
- for sym in choice.get_items():
+ for sym in choice.get_actual_items():
if sym.calc_value() != "m" and \
sym.get_upper_bound() != "n":
sym.set_value("m")
done = False
-
- if done:
- break
-
conf.write_config(".config")