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 62cb55a commit 7d7467f20c1e19be51154779eb4ef6a70ddf0e0d
@@ -431,15 +431,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):
@@ -533,6 +533,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
@@ -331,13 +331,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 7d7467f

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