From 7374891d0a9b455ff7d20e84efd0e6b1e3705c11 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 25 Mar 2018 23:51:45 +0200 Subject: merge_config.py: Clean up name_and_loc_str() - Rename to name_and_loc(), to be consistent with the kconfiglib.py version - Use a comment instead of a docstring. Shorten the description a bit too. - Piggyback a missing # in conf3 in the module docstring. Typo. --- examples/merge_config.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/merge_config.py b/examples/merge_config.py index a6110f8..a51738c 100644 --- a/examples/merge_config.py +++ b/examples/merge_config.py @@ -37,7 +37,7 @@ # # Ops... assigned twice # # CONFIG_FOO is not set # -# Ops... this symbol doesn't exist +# # Ops... this symbol doesn't exist # CONFIG_OPS=y # # CONFIG_BAZ="baz string" @@ -85,12 +85,9 @@ kconf.write_config(sys.argv[2]) # Print warnings for symbols whose actual value doesn't match the assigned # value -def name_and_loc_str(sym): - """ - Helper for printing the symbol name along with the location(s) in the - Kconfig files where the symbol is defined - """ - # If the symbol has no menu nodes, it is undefined +def name_and_loc(sym): + # Helper for printing symbol names and Kconfig file location(s) in warnings + if not sym.nodes: return sym.name + " (undefined)" @@ -112,4 +109,4 @@ for sym in kconf.defined_syms: if user_value != sym.str_value: print('warning: {} was assigned the value "{}" but got the ' 'value "{}" -- check dependencies' - .format(name_and_loc_str(sym), user_value, sym.str_value)) + .format(name_and_loc(sym), user_value, sym.str_value)) -- cgit v1.2.3