Skip to content
Permalink
Browse files

[Processing] Add shortHelp for Scripts, Models and R

And enhance getParameterDescriptions
  • Loading branch information
rldhont committed May 28, 2016
1 parent 2c1f2ce commit 8592a7e3ac9aa82b86a84e2abcc8f1a3d4b127f7
@@ -434,15 +434,34 @@ def help(self):
else:
return False, None

def shortHelp(self):
if self.descriptionFile is None:
return None
helpFile = unicode(self.descriptionFile) + '.help'
if os.path.exists(helpFile):
with open(helpFile) as f:
try:
descriptions = json.load(f)
if 'ALG_DESC' in descriptions:
return self._formatHelp(unicode(descriptions['ALG_DESC']))
except:
return None
return None

def getParameterDescriptions(self):
descs = {}
helpfile = unicode(self.descriptionFile) + '.help'
if os.path.exists(helpfile):
if self.descriptionFile is None:
return 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])
try:
descriptions = json.load(f)
for param in self.parameters:
if param.name in descriptions:
descs[param.name] = unicode(descriptions[param.name])
except:
return None
return descs

def checkBeforeOpeningParametersDialog(self):
@@ -544,6 +544,11 @@ def help(self):
except:
return False, None

def shortHelp(self):
if 'ALG_DESC' in self.helpContent:
return self._formatHelp(unicode(self.helpContent['ALG_DESC']))
return None

def getParameterDescriptions(self):
descs = {}
descriptions = self.helpContent
@@ -349,13 +349,32 @@ def help(self):
else:
return False, None

def shortHelp(self):
if self.descriptionFile is None:
return None
helpFile = unicode(self.descriptionFile) + '.help'
if os.path.exists(helpFile):
with open(helpFile) as f:
try:
descriptions = json.load(f)
if 'ALG_DESC' in descriptions:
return self._formatHelp(unicode(descriptions['ALG_DESC']))
except:
return None
return None

def getParameterDescriptions(self):
descs = {}
helpfile = unicode(self.descriptionFile) + '.help'
if os.path.exists(helpfile):
if self.descriptionFile is None:
return 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])
try:
descriptions = json.load(f)
for param in self.parameters:
if param.name in descriptions:
descs[param.name] = unicode(descriptions[param.name])
except:
return None
return descs

0 comments on commit 8592a7e

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