Skip to content
Permalink
Browse files

Remove some unused code

  • Loading branch information
nyalldawson committed Jun 6, 2017
1 parent a27c22d commit 2f28736e8e85554893b32de9b53e59720f91296c
Showing with 0 additions and 64 deletions.
  1. +0 −30 python/plugins/processing/core/parameters.py
  2. +0 −34 python/plugins/processing/gui/wrappers.py
@@ -585,36 +585,6 @@ class ParameterRaster(ParameterDataObject):
def __init__(self, name='', description='', optional=False, showSublayersDialog=True):
ParameterDataObject.__init__(self, name, description, None, optional)
self.showSublayersDialog = parseBool(showSublayersDialog)
self.exported = None

def getSafeExportedLayer(self):
"""Returns not the value entered by the user, but a string with
a filename which contains the data of this layer, but saved in
a standard format (currently always a geotiff file) so that it
can be opened by most external applications.
Works only if the layer represented by the parameter value is
currently loaded in QGIS. Otherwise, it will not perform any
export and return the current value string.
If the current value represents a layer in a suitable format,
it does not export at all and returns that value.
The layer is exported just the first time the method is called.
The method can be called several times and it will always
return the same file, performing the export only the first
time.
"""
context = dataobjects.createContext()

if self.exported:
return self.exported
layer = QgsProcessingUtils.mapLayerFromString(self.value, context, False)
if layer:
self.exported = dataobjects.exportRasterLayer(layer)
else:
self.exported = self.value
return self.exported

def getAsScriptCode(self):
param_type = ''
@@ -1232,40 +1232,6 @@ def validator(v):
return self.comboValue(validator)


def getFileFilter(param):
"""
Returns a suitable file filter pattern for the specified parameter definition
:param param:
:return:
"""
if param.type() == 'multilayer':
if param.layerType() == QgsProcessingParameterDefinition.TypeRaster:
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
elif param.layerType() == QgsProcessingParameterDefinition.TypeFile:
return self.tr('All files (*.*)', 'QgsProcessingParameterMultipleLayers')
else:
exts = QgsVectorFileWriter.supportedFormatExtensions()
for i in range(len(exts)):
exts[i] = self.tr('{0} files (*.{1})', 'QgsProcessingParameterMultipleLayers').format(exts[i].upper(), exts[i].lower())
return ';;'.join(exts)
elif param.type() == 'raster':
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
for i in range(len(exts)):
exts[i] = self.tr('{0} files (*.{1})', 'ParameterRaster').format(exts[i].upper(), exts[i].lower())
return ';;'.join(exts)
elif param.type() == 'table':
exts = ['csv', 'dbf']
for i in range(len(exts)):
exts[i] = self.tr('{0} files (*.{1})', 'ParameterTable').format(exts[i].upper(), exts[i].lower())
return ';;'.join(exts)
elif param.type() == 'sink':
exts = QgsVectorFileWriter.supportedFormatExtensions()
for i in range(len(exts)):
exts[i] = self.tr('{0} files (*.{1})', 'ParameterVector').format(exts[i].upper(), exts[i].lower())
return ';;'.join(exts)
return ''


class WidgetWrapperFactory:

"""

0 comments on commit 2f28736

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