mirror of
https://github.com/qgis/QGIS.git
synced 2025-06-19 00:02:48 -04:00
[processing] extension can now be specified for OutputFile
This commit is contained in:
parent
a7cb486f61
commit
60f782441a
@ -45,7 +45,7 @@ class Output(object):
|
||||
# in a vector layer). In the case of layers, hidden outputs are
|
||||
# not loaded into QGIS after the algorithm is executed. Other
|
||||
# outputs not representing layers or tables should always be hidden.
|
||||
self.hidden = hidden
|
||||
self.hidden = str(hidden).lower() == str(True).lower()
|
||||
|
||||
# This value indicates whether the output has to be opened
|
||||
# after being produced by the algorithm or not
|
||||
|
@ -53,4 +53,4 @@ class OutputFactory:
|
||||
if len(tokens) == 2:
|
||||
return clazz(tokens[0], tokens[1])
|
||||
else:
|
||||
return clazz(tokens[0], tokens[1], tokens[2] == str(True))
|
||||
return clazz(tokens[0], tokens[1], tokens[2])
|
||||
|
@ -30,8 +30,16 @@ from processing.outputs.Output import Output
|
||||
|
||||
class OutputFile(Output):
|
||||
|
||||
def __init__(self, name='', description='', ext = None):
|
||||
self.name = name
|
||||
self.description = description
|
||||
self.ext = ext
|
||||
|
||||
def getFileFilter(self, alg):
|
||||
return 'All files(*.*)'
|
||||
if self.ext is None:
|
||||
return 'All files(*.*)'
|
||||
else:
|
||||
return '%s files(*.%s)' % self.ext
|
||||
|
||||
def getDefaultFileExtension(self, alg):
|
||||
return 'file'
|
||||
return self.ext or 'file'
|
||||
|
Loading…
x
Reference in New Issue
Block a user