From 18ddb6df8f6906d0f27e0730a816156b290a965a Mon Sep 17 00:00:00 2001 From: Tim <81219429+JTvD@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:38:02 +0100 Subject: [PATCH] added nuitka exe compatability (#292) --- ibridgesgui/browser.py | 2 +- ibridgesgui/info.py | 2 +- ibridgesgui/login.py | 2 +- ibridgesgui/logviewer.py | 2 +- ibridgesgui/popup_widgets.py | 12 ++++++------ ibridgesgui/search.py | 2 +- ibridgesgui/sync.py | 2 +- ibridgesgui/welcome.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ibridgesgui/browser.py b/ibridgesgui/browser.py index 78bc8dc7..56c085da 100644 --- a/ibridgesgui/browser.py +++ b/ibridgesgui/browser.py @@ -29,7 +29,7 @@ class Browser(PyQt6.QtWidgets.QWidget, Ui_tabBrowser): def __init__(self, session, app_name: str): """Initialize an iRODS browser view.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: PyQt6.uic.loadUi(UI_FILE_DIR / "tabBrowser.ui", self) diff --git a/ibridgesgui/info.py b/ibridgesgui/info.py index 90644ebe..7a7e1bac 100644 --- a/ibridgesgui/info.py +++ b/ibridgesgui/info.py @@ -18,7 +18,7 @@ class Info(PyQt6.QtWidgets.QWidget, Ui_tabInfo): def __init__(self, session): """Initialise the tab.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: PyQt6.uic.loadUi(UI_FILE_DIR / "tabInfo.ui", self) diff --git a/ibridgesgui/login.py b/ibridgesgui/login.py index 2de39e5d..831b7fce 100644 --- a/ibridgesgui/login.py +++ b/ibridgesgui/login.py @@ -34,7 +34,7 @@ class Login(QDialog, Ui_irodsLogin): def __init__(self, session_dict, app_name): """Initialise tab.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: loadUi(UI_FILE_DIR / "irodsLogin.ui", self) diff --git a/ibridgesgui/logviewer.py b/ibridgesgui/logviewer.py index ff48e4dd..9a85f021 100644 --- a/ibridgesgui/logviewer.py +++ b/ibridgesgui/logviewer.py @@ -35,7 +35,7 @@ class LogViewer(PyQt6.QtWidgets.QWidget, Ui_tabLogging): def __init__(self, logger): """Initialise the tab.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: PyQt6.uic.loadUi(UI_FILE_DIR / "tabLogging.ui", self) diff --git a/ibridgesgui/popup_widgets.py b/ibridgesgui/popup_widgets.py index 4d47efa9..cd33bbe7 100644 --- a/ibridgesgui/popup_widgets.py +++ b/ibridgesgui/popup_widgets.py @@ -29,7 +29,7 @@ class CreateCollection(QDialog, Ui_createCollection): def __init__(self, parent, logger): """Initialise window.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: loadUi(UI_FILE_DIR / "createCollection.ui", self) @@ -68,7 +68,7 @@ class CreateDirectory(QDialog, Ui_createCollection): def __init__(self, parent): """Initialise window.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: loadUi(UI_FILE_DIR / "createCollection.ui", self) @@ -100,7 +100,7 @@ class Rename(QDialog, Ui_renameItem): def __init__(self, irods_path: IrodsPath, logger): """Initialise window.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: loadUi(UI_FILE_DIR / "renameItem.ui", self) @@ -137,7 +137,7 @@ class CheckConfig(QDialog, Ui_configCheck): def __init__(self, logger, env_path): """Initialise window.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: loadUi(UI_FILE_DIR / "configCheck.ui", self) @@ -280,7 +280,7 @@ class UploadData(QDialog, Ui_uploadData): def __init__(self, logger, session, irods_path): """Initialise window.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: loadUi(UI_FILE_DIR / "uploadData.ui", self) @@ -430,7 +430,7 @@ class DownloadData(QDialog, Ui_downloadData): def __init__(self, logger, session, irods_path): """Initialise window.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: loadUi(UI_FILE_DIR / "downloadData.ui", self) diff --git a/ibridgesgui/search.py b/ibridgesgui/search.py index 5e28b69e..80739ee8 100644 --- a/ibridgesgui/search.py +++ b/ibridgesgui/search.py @@ -36,7 +36,7 @@ def __init__(self, session, app_name, browser): """ super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: PyQt6.uic.loadUi(UI_FILE_DIR / "tabSearch.ui", self) diff --git a/ibridgesgui/sync.py b/ibridgesgui/sync.py index 3bb3f5e1..9286302e 100644 --- a/ibridgesgui/sync.py +++ b/ibridgesgui/sync.py @@ -30,7 +30,7 @@ def __init__(self, session, app_name): """ super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: PyQt6.uic.loadUi(UI_FILE_DIR / "tabSync.ui", self) diff --git a/ibridgesgui/welcome.py b/ibridgesgui/welcome.py index fc4ce545..74f0018b 100644 --- a/ibridgesgui/welcome.py +++ b/ibridgesgui/welcome.py @@ -18,7 +18,7 @@ class Welcome(PyQt6.QtWidgets.QWidget, Ui_Welcome): def __init__(self): """Initialize welcome tab.""" super().__init__() - if getattr(sys, "frozen", False): + if getattr(sys, "frozen", False) or ("__compiled__" in globals()): super().setupUi(self) else: PyQt6.uic.loadUi(UI_FILE_DIR / "welcome.ui", self)