Skip to content

Commit 5a00172

Browse files
committedMay 26, 2016
[BUGFIX][Processing] Add getParameterDescriptions to R, Model and Script algo
1 parent 90b313c commit 5a00172

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
 

‎python/plugins/processing/algs/r/RAlgorithm.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,17 @@ def help(self):
431431
else:
432432
return False, None
433433

434+
def getParameterDescriptions(self):
435+
descs = {}
436+
helpfile = unicode(self.descriptionFile) + '.help'
437+
if os.path.exists(helpfile):
438+
with open(helpFile) as f:
439+
descriptions = json.load(f)
440+
for param in self.parameters:
441+
if param.name in descriptions:
442+
descs[param.name] = unicode(descriptions[param.name])
443+
return descs
444+
434445
def checkBeforeOpeningParametersDialog(self):
435446
msg = RUtils.checkRIsInstalled()
436447
if msg is not None:

‎python/plugins/processing/modeler/ModelerAlgorithm.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,14 @@ def help(self):
533533
except:
534534
return False, None
535535

536+
def getParameterDescriptions(self):
537+
descs = {}
538+
descriptions = self.helpContent
539+
for param in self.parameters:
540+
if param.name in descriptions:
541+
descs[param.name] = unicode(descriptions[param.name])
542+
return descs
543+
536544
def todict(self):
537545
keys = ["inputs", "group", "name", "algs", "helpContent"]
538546
return {k: v for k, v in self.__dict__.iteritems() if k in keys}

‎python/plugins/processing/script/ScriptAlgorithm.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,14 @@ def help(self):
330330
return True, getHtmlFromHelpFile(self, helpfile)
331331
else:
332332
return False, None
333+
334+
def getParameterDescriptions(self):
335+
descs = {}
336+
helpfile = unicode(self.descriptionFile) + '.help'
337+
if os.path.exists(helpfile):
338+
with open(helpFile) as f:
339+
descriptions = json.load(f)
340+
for param in self.parameters:
341+
if param.name in descriptions:
342+
descs[param.name] = unicode(descriptions[param.name])
343+
return descs

0 commit comments

Comments
 (0)
Please sign in to comment.