summaryrefslogtreecommitdiff
path: root/examples/print_undefined.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-06 17:01:09 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-06 17:01:29 +0100
commitc805e3143bada2df897927996ae23a469cf83eb3 (patch)
tree38212ced8df505ee2814ac5b8d29460f0fa5e98b /examples/print_undefined.py
parent94fb111d02b95413f7c36d923dabd4ec1ca1c90e (diff)
Move examples into separate directory.
Diffstat (limited to 'examples/print_undefined.py')
-rw-r--r--examples/print_undefined.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/print_undefined.py b/examples/print_undefined.py
new file mode 100644
index 0000000..82a29d3
--- /dev/null
+++ b/examples/print_undefined.py
@@ -0,0 +1,15 @@
+# Prints the names of all symbols that are referenced but never defined in the
+# current configuration together with the locations where they are referenced.
+# Integers being included in the list is not a bug, as these need to be treated
+# as symbols per the design of Kconfig.
+
+import kconfiglib
+import sys
+
+conf = kconfiglib.Config(sys.argv[1])
+
+for sym in conf.get_symbols():
+ if not sym.is_defined():
+ print sym.get_name()
+ for (filename, linenr) in sym.get_ref_locations():
+ print " {0}:{1}".format(filename, linenr)