summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-10-12 23:51:37 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-10-13 00:23:34 +0200
commitbde4cc71fc01f209e1df0916843d351be201f78e (patch)
tree238dc144f0f1d75e44f42d6165679ab4443540e0 /kconfiglib.py
parent9b09e2b72e4214cc48ddad6c9b33dbe59f59c7ce (diff)
Add some hints re. generating custom configuration output
It's not obvious that Symbol.config_string can be useful even when generating other output formats, as it provides a hook for _write_to_conf. Mention it in the 'config_string' documentation and in relevant parts of the README.
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 1af640e..b6c1d4a 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -3450,8 +3450,29 @@ class Symbol(object):
config_string:
The .config assignment string that would get written out for the symbol
by Kconfig.write_config(). Returns the empty string if no .config
- assignment would get written out. In general, visible symbols, symbols
- with (active) defaults, and selected symbols get written out.
+ assignment would get written out.
+
+ In general, visible symbols, symbols with (active) defaults, and selected
+ symbols get written out. This includes all non-n-valued bool/tristate
+ symbols, and all visible string/int/hex symbols.
+
+ Symbols with the (no longer needed) 'option env=...' option generate no
+ configuration output, and neither does the special
+ 'option defconfig_list' symbol.
+
+ Tip: This field is useful when generating custom configuration output,
+ even for non-.config-like formats. To write just the symbols that would
+ get written out to .config files, do this:
+
+ if sym.config_string:
+ *Write symbol, e.g. by looking sym.str_value*
+
+ This is a superset of the symbols written out by write_autoconf().
+ That function skips all n-valued symbols.
+
+ There usually won't be any great harm in just writing all symbols either,
+ though you might get some special symbols and possibly some "redundant"
+ n-valued symbol entries in there.
nodes:
A list of MenuNodes for this symbol. Will contain a single MenuNode for