diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-09-27 18:51:07 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-09-27 19:47:52 +0200 |
| commit | d0ebcc592c74995957f3b7f46408fb3a528142f4 (patch) | |
| tree | 00988330497913005a07f344082bf9ef04c5e728 | |
| parent | 43d2003d82dcc4e5329c6020f350600eaef2c4d7 (diff) | |
Simplify the defconfig and eval_expr examples a bit
Style nits.
| -rw-r--r-- | examples/defconfig.py | 7 | ||||
| -rw-r--r-- | examples/eval_expr.py | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/examples/defconfig.py b/examples/defconfig.py index cc3f12d..a8abbe6 100644 --- a/examples/defconfig.py +++ b/examples/defconfig.py @@ -13,10 +13,9 @@ kconf = kconfiglib.Kconfig(sys.argv[1]) if os.path.exists(".config"): print("using existing .config") kconf.load_config(".config") -else: - if kconf.defconfig_filename is not None: - print("using " + kconf.defconfig_filename) - kconf.load_config(kconf.defconfig_filename) +elif kconf.defconfig_filename is not None: + print("using " + kconf.defconfig_filename) + kconf.load_config(kconf.defconfig_filename) kconf.write_config(".config") print("configuration written to .config") diff --git a/examples/eval_expr.py b/examples/eval_expr.py index 6d8695e..41fc8a2 100644 --- a/examples/eval_expr.py +++ b/examples/eval_expr.py @@ -12,9 +12,8 @@ import sys if len(sys.argv) < 3: sys.exit("Pass the expression to evaluate with SCRIPT_ARG=<expression>") -expr = sys.argv[2] - kconf = kconfiglib.Kconfig(sys.argv[1]) +expr = sys.argv[2] # Enable modules so that m doesn't get demoted to n kconf.modules.set_value(2) |
