From 1e849a45ec822b29fd35dc26e2690dcf36074fd4 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 22 Apr 2025 18:12:50 +0200 Subject: [PATCH 1/2] Show an information when the dep folder is missing --- a00_qpip/plugin.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/a00_qpip/plugin.py b/a00_qpip/plugin.py index f57c287..48c8ba5 100644 --- a/a00_qpip/plugin.py +++ b/a00_qpip/plugin.py @@ -276,12 +276,20 @@ def check(self): self.save_settings(dialog) def show_folder(self): - if platform.system() == "Windows": - os.startfile(self.prefix_path) - elif platform.system() == "Darwin": - subprocess.Popen(["open", self.prefix_path]) + if os.path.isdir(self.prefix_path): + if platform.system() == "Windows": + os.startfile(self.prefix_path) + elif platform.system() == "Darwin": + subprocess.Popen(["open", self.prefix_path]) + else: + subprocess.Popen(["xdg-open", self.prefix_path]) else: - subprocess.Popen(["xdg-open", self.prefix_path]) + self.iface.messageBar().pushMessage( + "QPIP", + f"The folder {self.prefix_path} has not yet been created. It will be created when dependencies are installed.", + level=Qgis.Info, + duration=5 + ) def _check_on_startup(self): return self.settings.value("check_on_startup", "no") == "yes" From 18e0d57642f149463844bb4ab0c613a3c1cd521e Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Wed, 23 Apr 2025 07:58:12 +0200 Subject: [PATCH 2/2] Update plugin.py --- a00_qpip/plugin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/a00_qpip/plugin.py b/a00_qpip/plugin.py index 48c8ba5..8b9534c 100644 --- a/a00_qpip/plugin.py +++ b/a00_qpip/plugin.py @@ -285,11 +285,11 @@ def show_folder(self): subprocess.Popen(["xdg-open", self.prefix_path]) else: self.iface.messageBar().pushMessage( - "QPIP", - f"The folder {self.prefix_path} has not yet been created. It will be created when dependencies are installed.", - level=Qgis.Info, - duration=5 - ) + "QPIP", + f"The folder {self.prefix_path} has not yet been created. It will be created when dependencies are installed.", + level=Qgis.Info, + duration=5 + ) def _check_on_startup(self): return self.settings.value("check_on_startup", "no") == "yes"