diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2019-03-06 01:58:06 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2019-03-06 02:03:41 +0100 |
| commit | 553cca8e7417ad863b923758e6d402296d05de9c (patch) | |
| tree | 662852d136f1f2ab661d5bcd5f3dabdc9c408b8b | |
| parent | b07c2053de324d974521c83e7a073ff1330b74d8 (diff) | |
Use a consistent style in small utilities
Also remove some no longer used imports.
| -rwxr-xr-x | alldefconfig.py | 2 | ||||
| -rwxr-xr-x | allmodconfig.py | 2 | ||||
| -rwxr-xr-x | allnoconfig.py | 2 | ||||
| -rwxr-xr-x | allyesconfig.py | 2 | ||||
| -rwxr-xr-x | genconfig.py | 3 | ||||
| -rwxr-xr-x | listnewconfig.py | 3 | ||||
| -rwxr-xr-x | oldconfig.py | 5 | ||||
| -rwxr-xr-x | olddefconfig.py | 3 |
8 files changed, 15 insertions, 7 deletions
diff --git a/alldefconfig.py b/alldefconfig.py index 37b8f71..4f0cbca 100755 --- a/alldefconfig.py +++ b/alldefconfig.py @@ -15,10 +15,12 @@ import kconfiglib + def main(): kconf = kconfiglib.standard_kconfig() kconfiglib.load_allconfig(kconf, "alldef.config") kconf.write_config() + if __name__ == "__main__": main() diff --git a/allmodconfig.py b/allmodconfig.py index 1064678..f7c6608 100755 --- a/allmodconfig.py +++ b/allmodconfig.py @@ -15,6 +15,7 @@ import kconfiglib + def main(): kconf = kconfiglib.standard_kconfig() @@ -44,5 +45,6 @@ def main(): kconf.write_config() + if __name__ == "__main__": main() diff --git a/allnoconfig.py b/allnoconfig.py index d5bad33..d4aa8d0 100755 --- a/allnoconfig.py +++ b/allnoconfig.py @@ -17,6 +17,7 @@ import kconfiglib + def main(): kconf = kconfiglib.standard_kconfig() @@ -38,5 +39,6 @@ def main(): kconf.write_config() + if __name__ == "__main__": main() diff --git a/allyesconfig.py b/allyesconfig.py index 5adbf0c..e475329 100755 --- a/allyesconfig.py +++ b/allyesconfig.py @@ -33,6 +33,7 @@ import kconfiglib + def main(): kconf = kconfiglib.standard_kconfig() @@ -61,5 +62,6 @@ def main(): kconf.write_config() + if __name__ == "__main__": main() diff --git a/genconfig.py b/genconfig.py index 77d783c..f83fd4c 100755 --- a/genconfig.py +++ b/genconfig.py @@ -20,9 +20,11 @@ import argparse import kconfiglib + DEFAULT_HEADER_PATH = "config.h" DEFAULT_SYNC_DEPS_PATH = "deps/" + def main(): parser = argparse.ArgumentParser(description=""" Generates a header file with defines from the configuration. Optionally @@ -82,5 +84,6 @@ KCONFIG_CONFIG environment variable.""") if args.config_path is not None: kconf.write_config(args.config_path, save_old=False) + if __name__ == "__main__": main() diff --git a/listnewconfig.py b/listnewconfig.py index 16f44f9..a9f8445 100755 --- a/listnewconfig.py +++ b/listnewconfig.py @@ -13,7 +13,7 @@ import sys from kconfiglib import standard_kconfig, BOOL, TRISTATE, INT, HEX, STRING, \ TRI_TO_STR -import kconfiglib + def main(): kconf = standard_kconfig() @@ -39,5 +39,6 @@ def main(): sys.stdout.write(s) + if __name__ == "__main__": main() diff --git a/oldconfig.py b/oldconfig.py index 8d35cc4..055203c 100755 --- a/oldconfig.py +++ b/oldconfig.py @@ -23,11 +23,10 @@ from __future__ import print_function -import os import sys -from kconfiglib import Kconfig, Symbol, Choice, BOOL, TRISTATE, HEX, \ - standard_kconfig +from kconfiglib import Symbol, Choice, BOOL, TRISTATE, HEX, standard_kconfig + # Python 2/3 compatibility hack if sys.version_info[0] < 3: diff --git a/olddefconfig.py b/olddefconfig.py index 4a23db3..7edb76f 100755 --- a/olddefconfig.py +++ b/olddefconfig.py @@ -11,9 +11,6 @@ # The default output filename is '.config'. A different filename can be passed # in the KCONFIG_CONFIG environment variable. -import os -import sys - import kconfiglib |
