Skip to content

Commit

Permalink
STY: clean up debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
ruokolt committed Dec 15, 2023
1 parent a120262 commit 76f487c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: vai-lab-env
channels:
- conda-forge
dependencies:
- python=3.7
- python=3.6
- c-compiler
- pandas
- pillow
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand Down
2 changes: 1 addition & 1 deletion src/vai_lab/Core/vai_lab_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/vai_lab/GUI/GUI_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down
23 changes: 4 additions & 19 deletions src/vai_lab/_import_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 76f487c

Please sign in to comment.