From d390ebdceb4f279a8e9a0683724201968dee844c Mon Sep 17 00:00:00 2001 From: volaya Date: Wed, 18 May 2016 13:42:32 +0200 Subject: [PATCH] [processing] show script in toolbox even if it contains errors --- python/plugins/processing/script/ScriptAlgorithm.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/plugins/processing/script/ScriptAlgorithm.py b/python/plugins/processing/script/ScriptAlgorithm.py index 3ea6f9e4f12..e0d157bf4c5 100644 --- a/python/plugins/processing/script/ScriptAlgorithm.py +++ b/python/plugins/processing/script/ScriptAlgorithm.py @@ -92,6 +92,7 @@ class ScriptAlgorithm(GeoAlgorithm): return self._icon def defineCharacteristicsFromFile(self): + self.error = None self.script = '' self.silentOutputs = [] filename = os.path.basename(self.descriptionFile) @@ -104,9 +105,8 @@ class ScriptAlgorithm(GeoAlgorithm): try: self.processParameterLine(line.strip('\n')) except: - raise WrongScriptException( - self.tr('Could not load script: %s\n' - 'Problem with line: %s', 'ScriptAlgorithm') % (self.descriptionFile, line)) + self.error = self.tr('This script has a syntax errors.\n' + 'Problem with line: %s', 'ScriptAlgorithm') % line self.script += line line = lines.readline() lines.close() @@ -126,6 +126,10 @@ class ScriptAlgorithm(GeoAlgorithm): except: pass + + def checkBeforeOpeningParametersDialog(self): + return self.error + def checkInputCRS(self): if self.noCRSWarning: return True