diff --git a/src/asammdf/gui/asammdfgui.py b/src/asammdf/gui/asammdfgui.py index e1ef8a601..50a9aeb29 100644 --- a/src/asammdf/gui/asammdfgui.py +++ b/src/asammdf/gui/asammdfgui.py @@ -2,24 +2,6 @@ import os import sys -os.environ["QT_API"] = "pyside6" -os.environ["PYQTGRAPH_QT_LIB"] = "PySide6" - -alternative_sitepacakges = os.environ.get("ASAMMDF_PYTHONPATH", "") - -if alternative_sitepacakges: - os.environ["PYTHONPATH"] = alternative_sitepacakges - sys.path.insert(0, alternative_sitepacakges) - -import pyqtgraph -from PySide6 import QtWidgets - -from asammdf.gui.utils import excepthook, set_app_user_model_id -from asammdf.gui.widgets.main import MainWindow -from asammdf.gui.widgets.plot import monkey_patch_pyqtgraph - -sys.excepthook = excepthook - def _cmd_line_parser(): """""" @@ -30,6 +12,24 @@ def _cmd_line_parser(): def main(measurements=None): + os.environ["QT_API"] = "pyside6" + os.environ["PYQTGRAPH_QT_LIB"] = "PySide6" + + alternative_sitepacakges = os.environ.get("ASAMMDF_PYTHONPATH", "") + + if alternative_sitepacakges: + os.environ["PYTHONPATH"] = alternative_sitepacakges + sys.path.insert(0, alternative_sitepacakges) + + import pyqtgraph + from PySide6 import QtWidgets + + from asammdf.gui.utils import excepthook, set_app_user_model_id + from asammdf.gui.widgets.main import MainWindow + from asammdf.gui.widgets.plot import monkey_patch_pyqtgraph + + sys.excepthook = excepthook + monkey_patch_pyqtgraph() parser = _cmd_line_parser() args = parser.parse_args(sys.argv[1:])