From 958a1ae750f1b1e814bcf434585c7c901473f116 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 30 Oct 2017 16:17:16 +0100 Subject: Merge user_str/tri_value into user_value user_str_value isn't justified any more with the other API improvements. user_value now stores 0, 1, 2 for bool/tristate symbols, and a string for other symbol types. Much simpler and more intuitive. Also avoid printing quotes around tristate values in __repr__(). This was inconsistent too as it was only done for the value and user value. Should be getting close to final API. --- examples/allyesconfig.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/allyesconfig.py b/examples/allyesconfig.py index 6e2e065..efac3cf 100644 --- a/examples/allyesconfig.py +++ b/examples/allyesconfig.py @@ -91,16 +91,16 @@ while 1: selection.set_value(2) no_changes = False - # Handle a choice whose visibility only allows it to be in "m" mode. - # This might happen if a choice depends on a symbol that can only be - # "m", for example. + # Handle a choice whose visibility only allows it to be in m mode. This + # might happen if a choice depends on a symbol that can only be m, for + # example. elif choice.visibility == 1: for sym in choice.symbols: - # Does the choice have a symbol that can be "m" that we haven't - # already set to "m"? - if sym.user_tri_value != 1 and 1 in sym.assignable: + # Does the choice have a symbol that can be m that we haven't + # already set to m? + if sym.user_value != 1 and 1 in sym.assignable: # Yup, set it sym.set_value(1) -- cgit v1.2.3