diff --git a/python/plugins/processing/algs/r/RAlgorithm.py b/python/plugins/processing/algs/r/RAlgorithm.py index 988c757bdfc..7747046b98e 100644 --- a/python/plugins/processing/algs/r/RAlgorithm.py +++ b/python/plugins/processing/algs/r/RAlgorithm.py @@ -434,6 +434,17 @@ class RAlgorithm(GeoAlgorithm): else: return False, None + def getParameterDescriptions(self): + descs = {} + helpfile = unicode(self.descriptionFile) + '.help' + if os.path.exists(helpfile): + with open(helpFile) as f: + descriptions = json.load(f) + for param in self.parameters: + if param.name in descriptions: + descs[param.name] = unicode(descriptions[param.name]) + return descs + def checkBeforeOpeningParametersDialog(self): msg = RUtils.checkRIsInstalled() if msg is not None: diff --git a/python/plugins/processing/modeler/ModelerAlgorithm.py b/python/plugins/processing/modeler/ModelerAlgorithm.py index 71bf9ccf8eb..bd1985778fe 100644 --- a/python/plugins/processing/modeler/ModelerAlgorithm.py +++ b/python/plugins/processing/modeler/ModelerAlgorithm.py @@ -544,6 +544,14 @@ class ModelerAlgorithm(GeoAlgorithm): except: return False, None + def getParameterDescriptions(self): + descs = {} + descriptions = self.helpContent + for param in self.parameters: + if param.name in descriptions: + descs[param.name] = unicode(descriptions[param.name]) + return descs + def todict(self): keys = ["inputs", "group", "name", "algs", "helpContent"] return {k: v for k, v in self.__dict__.iteritems() if k in keys} diff --git a/python/plugins/processing/script/ScriptAlgorithm.py b/python/plugins/processing/script/ScriptAlgorithm.py index 78eda405dc7..0479ea885b6 100644 --- a/python/plugins/processing/script/ScriptAlgorithm.py +++ b/python/plugins/processing/script/ScriptAlgorithm.py @@ -105,7 +105,7 @@ class ScriptAlgorithm(GeoAlgorithm): self.processParameterLine(line.strip('\n')) except: self.error = self.tr('This script has a syntax errors.\n' - 'Problem with line: %s', 'ScriptAlgorithm') % line + 'Problem with line: %s', 'ScriptAlgorithm') % line self.script += line line = lines.readline() lines.close() @@ -124,7 +124,6 @@ class ScriptAlgorithm(GeoAlgorithm): except: pass - def checkBeforeOpeningParametersDialog(self): return self.error @@ -349,3 +348,14 @@ class ScriptAlgorithm(GeoAlgorithm): return True, getHtmlFromHelpFile(self, helpfile) else: return False, None + + def getParameterDescriptions(self): + descs = {} + helpfile = unicode(self.descriptionFile) + '.help' + if os.path.exists(helpfile): + with open(helpFile) as f: + descriptions = json.load(f) + for param in self.parameters: + if param.name in descriptions: + descs[param.name] = unicode(descriptions[param.name]) + return descs