From b40a947c533c9560fefa19eef991caa2eeb93614 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 31 Oct 2017 01:14:09 +0100 Subject: 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 '&& ' 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. --- examples/allyesconfig.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/allyesconfig.py') 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 -- cgit v1.2.3