diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-05-10 12:44:04 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-05-10 12:44:04 +0200 |
| commit | 748faee0687b4b2842c17ee881faa54e73353821 (patch) | |
| tree | cb4ebb808dbadece2199958e764c0a5e66b83905 | |
| parent | d79aaba38361c63deac9c9573d4543b67bfadcaa (diff) | |
Style nits
Air some long conditionals out a bit. Be more consistent with format().
| -rwxr-xr-x | menuconfig.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/menuconfig.py b/menuconfig.py index 9ceb631..81aed63 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -292,17 +292,21 @@ def menuconfig(kconf): if _config_filename is None: _config_filename = ".config" + if os.path.exists(_config_filename): print("Using existing configuration '{}' as base" .format(_config_filename)) _kconf.load_config(_config_filename) + elif kconf.defconfig_filename is not None: print("Using default configuration found in '{}' as base" .format(kconf.defconfig_filename)) _kconf.load_config(kconf.defconfig_filename) + else: print("Using default symbol values as base") + # Any visible items in the top menu? _show_all = False if not _shown_nodes(_kconf.top_node): @@ -1489,8 +1493,10 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win, # bad_re holds the error message from the re.error exception on errors _safe_addstr(matches_win, 0, 0, "Bad regular expression: " + bad_re) + elif not matches: _safe_addstr(matches_win, 0, 0, "No matches") + else: for i in range(scroll, min(scroll + matches_win.getmaxyx()[0], len(matches))): @@ -1503,8 +1509,8 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win, # Give menu locations as well for symbols that are defined in # multiple locations. The different menu locations will be # listed next to one another. - s2 += " (in menu {})".format( - _parent_menu(matches[i]).prompt[0]) + s2 += " (in menu {})" \ + .format(_parent_menu(matches[i]).prompt[0]) _safe_addstr(matches_win, i - scroll, 0, s2, style) |
