diff --git a/pype/tools/tray/__init__.py b/pype/tools/tray/__init__.py new file mode 100644 index 0000000000..38c59d2a43 --- /dev/null +++ b/pype/tools/tray/__init__.py @@ -0,0 +1,5 @@ +from .pype_tray import main + +__all__ = ( + "main", +) diff --git a/pype/tools/tray/__main__.py b/pype/tools/tray/__main__.py index a997e4302b..830cf45d0e 100644 --- a/pype/tools/tray/__main__.py +++ b/pype/tools/tray/__main__.py @@ -1,13 +1,7 @@ -import os -import sys +try: + from . import pype_tray +except ImportError: + import pype_tray -from . import pype_tray -app = pype_tray.PypeTrayApplication() -if os.name == "nt": - import ctypes - ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID( - u"pype_tray" - ) - -sys.exit(app.exec_()) +pype_tray.main() diff --git a/pype/tools/tray/pype_tray.py b/pype/tools/tray/pype_tray.py index c8c04d229a..edb3ffa251 100644 --- a/pype/tools/tray/pype_tray.py +++ b/pype/tools/tray/pype_tray.py @@ -255,3 +255,14 @@ class PypeTrayApplication(QtWidgets.QApplication): QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint ) return splash + + +def main(): + app = PypeTrayApplication() + if os.name == "nt": + import ctypes + ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID( + u"pype_tray" + ) + + sys.exit(app.exec_())