mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[processing] some minor improvements in script algorithm
This commit is contained in:
parent
5f42a2f730
commit
7f11ca4179
@ -185,7 +185,7 @@ class ScriptAlgorithm(GeoAlgorithm):
|
|||||||
found = True
|
found = True
|
||||||
break
|
break
|
||||||
if found:
|
if found:
|
||||||
param = ParameterTableField(tokens[0], tokens[0], field)
|
param = ParameterTableField(tokens[0], desc, field)
|
||||||
elif tokens[1].lower().strip().startswith('string'):
|
elif tokens[1].lower().strip().startswith('string'):
|
||||||
default = tokens[1].strip()[len('string') + 1:]
|
default = tokens[1].strip()[len('string') + 1:]
|
||||||
param = ParameterString(tokens[0], desc, default)
|
param = ParameterString(tokens[0], desc, default)
|
||||||
@ -207,6 +207,9 @@ class ScriptAlgorithm(GeoAlgorithm):
|
|||||||
out = OutputHTML()
|
out = OutputHTML()
|
||||||
elif tokens[1].lower().strip().startswith('output file'):
|
elif tokens[1].lower().strip().startswith('output file'):
|
||||||
out = OutputFile()
|
out = OutputFile()
|
||||||
|
subtokens = tokens[1].split(' ')
|
||||||
|
if len(subtokens > 2):
|
||||||
|
out.ext = subtokens[2]
|
||||||
elif tokens[1].lower().strip().startswith('output directory'):
|
elif tokens[1].lower().strip().startswith('output directory'):
|
||||||
out = OutputDirectory()
|
out = OutputDirectory()
|
||||||
elif tokens[1].lower().strip().startswith('output number'):
|
elif tokens[1].lower().strip().startswith('output number'):
|
||||||
@ -218,7 +221,7 @@ class ScriptAlgorithm(GeoAlgorithm):
|
|||||||
self.addParameter(param)
|
self.addParameter(param)
|
||||||
elif out is not None:
|
elif out is not None:
|
||||||
out.name = tokens[0]
|
out.name = tokens[0]
|
||||||
out.description = tokens[0]
|
out.description = desc
|
||||||
self.addOutput(out)
|
self.addOutput(out)
|
||||||
else:
|
else:
|
||||||
raise WrongScriptException('Could not load script:'
|
raise WrongScriptException('Could not load script:'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user