From d98ade6957d69fcad2ac49583127f3381f58db5d Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Fri, 12 Aug 2022 10:46:23 +0200 Subject: [PATCH] Incorporate suggestions --- gui/wxpython/wxgui.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gui/wxpython/wxgui.py b/gui/wxpython/wxgui.py index c40afca73ba..4a619a456d6 100644 --- a/gui/wxpython/wxgui.py +++ b/gui/wxpython/wxgui.py @@ -160,20 +160,18 @@ def process_opt(opts, args): return parsed_args -def print_wxgui_component_recent_files(args): +def print_wxgui_component_recent_files(recent_files): """Print wxGUI component recent files - :param args dict: parsed command-line args + :param str recent_files: app recent files name """ - recent_files_app_name = args.get("r") - if recent_files_app_name: - from gui_core.menu import RecentFilesConfig + from gui_core.menu import RecentFilesConfig - app = wx.App() - config = RecentFilesConfig(appName=recent_files_app_name) - for i in config.GetRecentFiles(): - print(i, file=sys.stderr) - sys.exit(1) + app = wx.App() + config = RecentFilesConfig(appName=recent_files) + for i in config.GetRecentFiles(): + print(i, file=sys.stderr) + sys.exit(1) def main(argv=None): @@ -196,7 +194,9 @@ def main(argv=None): parsed_args = process_opt(opts, args) - print_wxgui_component_recent_files(args=parsed_args) + recent_files = parsed_args.get("r") + if recent_files: + print_wxgui_component_recent_files(recent_files) app = GMApp(workspace=parsed_args.get("w"))