summaryrefslogtreecommitdiff
path: root/examples/allyesconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-10-30 16:17:16 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2017-10-30 17:03:32 +0100
commit958a1ae750f1b1e814bcf434585c7c901473f116 (patch)
treeebd36efdd2093f6b12b80ece0a73ccd855f04213 /examples/allyesconfig.py
parenta46d6627f2fcb095832413aa74942476462278ad (diff)
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.
Diffstat (limited to 'examples/allyesconfig.py')
-rw-r--r--examples/allyesconfig.py12
1 files changed, 6 insertions, 6 deletions
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)