From f715e95acebc66a38e981023630690bd64f0be6e Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 5 Apr 2019 15:20:15 +0200 Subject: menuconfig: Fix typo in comment in _load_dialog() Show-all mode is turned on if the node becomes invisible. The comment said the opposite if you didn't include the parenthesis. Piggyback some code nits. --- menuconfig.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/menuconfig.py b/menuconfig.py index 8d06e44..9ed46cc 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -1749,16 +1749,15 @@ def _load_dialog(): filename = "" while True: filename = _input_dialog("File to load", filename, _load_save_info()) - if filename is None: return False filename = os.path.expanduser(filename) if _try_load(filename): + # Turn on show-all mode if the selected node is not visible after + # loading the new configuration sel_node = _shown[_sel_node_i] - - # Turn on show-all mode if the current node is (no longer) visible if not (sel_node.prompt and expr_value(sel_node.prompt[1])): _show_all = True @@ -1766,7 +1765,7 @@ def _load_dialog(): # The message dialog indirectly updates the menu display, so _msg() # must be called after the new state has been initialized - _msg("Success", "Loaded {}".format(filename)) + _msg("Success", "Loaded " + filename) return True @@ -1806,7 +1805,6 @@ def _save_dialog(save_fn, default_filename, description): while True: filename = _input_dialog("Filename to save {} to".format(description), filename, _load_save_info()) - if filename is None: return False -- cgit v1.2.3