Skip to content
Permalink
Browse files

Merge pull request #3109 from rldhont/bugfix_processing_getParameterD…

…escriptions

[BUGFIX][Processing] Add getParameterDescriptions to R, Model and Scr…
  • Loading branch information
volaya committed May 26, 2016
2 parents ef3de28 + 5308918 commit d4802e5e9ea0c696bdc264ed5801439114219dcd
@@ -434,6 +434,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:
@@ -544,6 +544,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}
@@ -105,7 +105,7 @@ def defineCharacteristicsFromFile(self):
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 @@ def defineCharacteristicsFromScript(self):
except:
pass


def checkBeforeOpeningParametersDialog(self):
return self.error

@@ -349,3 +348,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 d4802e5

Please sign in to comment.
You can’t perform that action at this time.