From 5be0b8caffb0f549536c23334788095b71943c17 Mon Sep 17 00:00:00 2001 From: Felix Oesterle Date: Mon, 10 Feb 2025 11:26:38 +0100 Subject: [PATCH 1/2] Add platform-specific output directory opening in runIn1RelInfo_algorithm.py --- runIn1RelInfo_algorithm.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/runIn1RelInfo_algorithm.py b/runIn1RelInfo_algorithm.py index 22d1987..4704aca 100644 --- a/runIn1RelInfo_algorithm.py +++ b/runIn1RelInfo_algorithm.py @@ -30,7 +30,8 @@ import pathlib -import subprocess +import os +import platform from qgis.PyQt.QtCore import QCoreApplication @@ -147,10 +148,19 @@ def processAlgorithm(self, parameters, context, feedback): feedback.pushInfo("Find the release area info file here:") feedback.pushInfo(str(resDir.resolve())) + feedback.pushInfo("---------------------------------\n") + # Trying to show the output folder in the file explorer + outputDir = os.path.dirname(resDir) + if platform.system() == 'Windows': + os.startfile(outputDir) + elif platform.system() == 'Darwin': # macOS + os.system(f'open "{outputDir}"') + else: # Linux + os.system(f'xdg-open "{outputDir}"') + return {} - # return {self.OUTPUT: rasterResults} def name(self): """ From 14e22a82fba2bce9da03f41e486ee901d2c1a275 Mon Sep 17 00:00:00 2001 From: Felix Oesterle Date: Thu, 13 Feb 2025 09:28:25 +0100 Subject: [PATCH 2/2] Refactor error handling in avaframeConnector_commonFunc.py --- avaframeConnector_commonFunc.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/avaframeConnector_commonFunc.py b/avaframeConnector_commonFunc.py index 1ad9d48..e683aad 100644 --- a/avaframeConnector_commonFunc.py +++ b/avaframeConnector_commonFunc.py @@ -432,8 +432,7 @@ def runAndCheck(command, self, feedback): # Handle ERRORs elif "ERROR" in line: - cleanErrorMsg = "ERROR:" + line.split(":")[-1] - raise QgsProcessingException(self.tr(cleanErrorMsg)) + raise QgsProcessingException(self.tr(line)) else: print(line, flush=True) feedback.pushInfo(line)