From c805e3143bada2df897927996ae23a469cf83eb3 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Thu, 6 Dec 2012 17:01:09 +0100 Subject: Move examples into separate directory. --- examples/print_undefined.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/print_undefined.py (limited to 'examples/print_undefined.py') 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) -- cgit v1.2.3