Skip to content

Commit

Permalink
[BUGFIX][Processing] Add getParameterDescriptions to R, Model and Scr…
Browse files Browse the repository at this point in the history
…ipt algo
  • Loading branch information
rldhont committed May 26, 2016
1 parent 90b313c commit 5a00172
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/plugins/processing/algs/r/RAlgorithm.py
Expand Up @@ -431,6 +431,17 @@ def help(self):
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:
Expand Down
8 changes: 8 additions & 0 deletions python/plugins/processing/modeler/ModelerAlgorithm.py
Expand Up @@ -533,6 +533,14 @@ def help(self):
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}
Expand Down
11 changes: 11 additions & 0 deletions python/plugins/processing/script/ScriptAlgorithm.py
Expand Up @@ -330,3 +330,14 @@ def help(self):
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

0 comments on commit 5a00172

Please sign in to comment.