summaryrefslogtreecommitdiff
path: root/examples/allyesconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-10-31 01:14:09 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2017-10-31 21:49:42 +0100
commitb40a947c533c9560fefa19eef991caa2eeb93614 (patch)
tree49e07dde964f3e39d4822c08f095b76bc4336103 /examples/allyesconfig.py
parent4bf3332aa34a5b41b9b22233a069265a85713061 (diff)
Handle choices more like the C implementation
Choice symbols get the choice itself propagated to the conditions of their properties. This works since the Symbol/Choice value interfaces are compatible now. Simplifies value calculations and makes .assignable work automagically for choice symbols in choices in any mode. One drawback is that a '&& <choice>' now shows up on conditions when printing choice symbols, which is not valid Kconfig. That should be easy to work around if needed at least.
Diffstat (limited to 'examples/allyesconfig.py')
-rw-r--r--examples/allyesconfig.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/allyesconfig.py b/examples/allyesconfig.py
index efac3cf..1c85d60 100644
--- a/examples/allyesconfig.py
+++ b/examples/allyesconfig.py
@@ -80,6 +80,9 @@ while 1:
# Handle a choice whose visibility allows it to be in y mode
if choice.visibility == 2:
+ # Enable the choice in case it is optional
+ choice.set_value(2)
+
selection = choice.default_selection
# Does the choice have a default selection that we haven't already
@@ -96,6 +99,9 @@ while 1:
# example.
elif choice.visibility == 1:
+ # Enable the choice in case it is optional
+ choice.set_value(1)
+
for sym in choice.symbols:
# Does the choice have a symbol that can be m that we haven't