summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-08-22 02:25:20 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-08-22 20:05:11 +0200
commitd2c1430c91c574dc0dfd84f3652c8d9af8c77568 (patch)
tree11c0d1a6a9ef28d538bcd963e80ee47395db6c5f /examples
parenta3252f620fad970bbe8b7470401a04ee4225193e (diff)
Introduce Kconfig.unique_defined_syms and Kconfig.unique_choices
These are the same as Kconfig.defined_syms and Kconfig.choices, except duplicates are removed. Kconfig order is still preserved. This is almost always what you want when iterating through symbols and choices, as it potentially saves work, avoids generating duplicates when writing output, and still preserves Kconfig order for readability. The old attributes will be kept for backwards compatibility (maybe there's some rare cases where they could be useful too). They're created internally anyway.
Diffstat (limited to 'examples')
-rw-r--r--examples/allnoconfig_walk.py2
-rw-r--r--examples/defconfig_oldconfig.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/allnoconfig_walk.py b/examples/allnoconfig_walk.py
index 8e22cd9..b94a169 100644
--- a/examples/allnoconfig_walk.py
+++ b/examples/allnoconfig_walk.py
@@ -40,7 +40,7 @@ def do_allnoconfig(node):
kconf = Kconfig(sys.argv[1])
# Do an initial pass to set 'option allnoconfig_y' symbols to y
-for sym in kconf.defined_syms:
+for sym in kconf.unique_defined_syms:
if sym.is_allnoconfig_y:
sym.set_value(2)
diff --git a/examples/defconfig_oldconfig.py b/examples/defconfig_oldconfig.py
index 84aa134..3735ee1 100644
--- a/examples/defconfig_oldconfig.py
+++ b/examples/defconfig_oldconfig.py
@@ -29,7 +29,7 @@ kconf.write_config(".config")
# Mirrors the second oldconfig
kconf.load_config(".config")
kconf.syms["ETHERNET"].set_value(2)
-for s in kconf.defined_syms:
+for s in kconf.unique_defined_syms:
if s.user_value is None and 0 in s.assignable:
s.set_value(0)