From 76f487c53bd6ee544600af11363cc364c9db89a5 Mon Sep 17 00:00:00 2001 From: Teemu Ruokolainen Date: Fri, 15 Dec 2023 09:29:50 +0200 Subject: [PATCH] STY: clean up debugging code --- environment.yml | 2 +- pyproject.toml | 2 +- src/vai_lab/Core/vai_lab_core.py | 2 +- src/vai_lab/GUI/GUI_core.py | 6 +++--- src/vai_lab/_import_helper.py | 23 ++++------------------- 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/environment.yml b/environment.yml index 8c367826..f5325f86 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: vai-lab-env channels: - conda-forge dependencies: - - python=3.7 + - python=3.6 - c-compiler - pandas - pillow diff --git a/pyproject.toml b/pyproject.toml index a399a614..7e1970cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", 'Programming Language :: Python :: 3.11' ] -requires-python = ">=3.7" +requires-python = ">=3.6" version = "0.0.dev4" description = "AI assisted Virtual Laboratory framework." diff --git a/src/vai_lab/Core/vai_lab_core.py b/src/vai_lab/Core/vai_lab_core.py index 56a9d8a4..48ac46a8 100644 --- a/src/vai_lab/Core/vai_lab_core.py +++ b/src/vai_lab/Core/vai_lab_core.py @@ -27,7 +27,7 @@ def _launch(self): gui_app = GUI() gui_app._debug = self._debug gui_app.set_avail_plugins(self._avail_plugins) - gui_app.set_gui_as_startpage() # FIXME + gui_app.set_gui_as_startpage() gui_output = gui_app.launch() if not self._debug: try: diff --git a/src/vai_lab/GUI/GUI_core.py b/src/vai_lab/GUI/GUI_core.py index 296f0334..0ebb5df4 100644 --- a/src/vai_lab/GUI/GUI_core.py +++ b/src/vai_lab/GUI/GUI_core.py @@ -47,7 +47,7 @@ def set_options(self, module_config): def set_gui_as_startpage(self): self._is_startpage = True - self._load_plugin("main") # FIXME + self._load_plugin("main") self.xml_handler = XML_handler() self.xml_handler.new_config_file() @@ -80,7 +80,7 @@ def _add_UI_type_to_frames(self, ui_specs): plugin = import_plugin_absolute(globals(), ui_specs["_PLUGIN_PACKAGE"], - ui_specs["_PLUGIN_CLASS_NAME"]) # FIXME + ui_specs["_PLUGIN_CLASS_NAME"]) self._desired_ui_types.append(plugin) self._compare_layer_priority(ui_specs) if ui_specs["_PLUGIN_MODULE_OPTIONS"]["required_children"] != None: @@ -99,7 +99,7 @@ def _load_plugin(self, ui_type: list): for ui in ui_type: ui_specs = self._avail_plugins.find_from_readable_name(ui) try: - self._add_UI_type_to_frames(ui_specs) # FIXME + self._add_UI_type_to_frames(ui_specs) except ModuleNotFoundError as ex: from sys import exit print(ex.msg) diff --git a/src/vai_lab/_import_helper.py b/src/vai_lab/_import_helper.py index 70e4d514..c8d3204b 100644 --- a/src/vai_lab/_import_helper.py +++ b/src/vai_lab/_import_helper.py @@ -9,26 +9,11 @@ def import_plugin(script_config, plugin_name): return plugin_class def import_plugin_absolute(script_config,plugin_package,plugin_name): - print("script_config:", script_config) - print() - print("plugin_package:", plugin_package) - print() - print("plugin_name:", plugin_name) - - # FIXME - import traceback - try: - plugin_list = __import__(plugin_package, - script_config, - {}, - [plugin_name]) - except Exception as err: - print("\n\nERROR >>>\n\n") - print(traceback.format_exc()) - print("err:", err) - print("\n\n<<< ERROR\n\n") + plugin_list = __import__(plugin_package, + script_config, + {}, + [plugin_name]) - plugin_class = getattr(plugin_list, plugin_name) return plugin_class