Skip to content

Commit 2f28736

Browse files
committedJun 6, 2017
Remove some unused code
1 parent a27c22d commit 2f28736

File tree

2 files changed

+0
-64
lines changed

2 files changed

+0
-64
lines changed
 

‎python/plugins/processing/core/parameters.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -585,36 +585,6 @@ class ParameterRaster(ParameterDataObject):
585585
def __init__(self, name='', description='', optional=False, showSublayersDialog=True):
586586
ParameterDataObject.__init__(self, name, description, None, optional)
587587
self.showSublayersDialog = parseBool(showSublayersDialog)
588-
self.exported = None
589-
590-
def getSafeExportedLayer(self):
591-
"""Returns not the value entered by the user, but a string with
592-
a filename which contains the data of this layer, but saved in
593-
a standard format (currently always a geotiff file) so that it
594-
can be opened by most external applications.
595-
596-
Works only if the layer represented by the parameter value is
597-
currently loaded in QGIS. Otherwise, it will not perform any
598-
export and return the current value string.
599-
600-
If the current value represents a layer in a suitable format,
601-
it does not export at all and returns that value.
602-
603-
The layer is exported just the first time the method is called.
604-
The method can be called several times and it will always
605-
return the same file, performing the export only the first
606-
time.
607-
"""
608-
context = dataobjects.createContext()
609-
610-
if self.exported:
611-
return self.exported
612-
layer = QgsProcessingUtils.mapLayerFromString(self.value, context, False)
613-
if layer:
614-
self.exported = dataobjects.exportRasterLayer(layer)
615-
else:
616-
self.exported = self.value
617-
return self.exported
618588

619589
def getAsScriptCode(self):
620590
param_type = ''

‎python/plugins/processing/gui/wrappers.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,40 +1232,6 @@ def validator(v):
12321232
return self.comboValue(validator)
12331233

12341234

1235-
def getFileFilter(param):
1236-
"""
1237-
Returns a suitable file filter pattern for the specified parameter definition
1238-
:param param:
1239-
:return:
1240-
"""
1241-
if param.type() == 'multilayer':
1242-
if param.layerType() == QgsProcessingParameterDefinition.TypeRaster:
1243-
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
1244-
elif param.layerType() == QgsProcessingParameterDefinition.TypeFile:
1245-
return self.tr('All files (*.*)', 'QgsProcessingParameterMultipleLayers')
1246-
else:
1247-
exts = QgsVectorFileWriter.supportedFormatExtensions()
1248-
for i in range(len(exts)):
1249-
exts[i] = self.tr('{0} files (*.{1})', 'QgsProcessingParameterMultipleLayers').format(exts[i].upper(), exts[i].lower())
1250-
return ';;'.join(exts)
1251-
elif param.type() == 'raster':
1252-
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
1253-
for i in range(len(exts)):
1254-
exts[i] = self.tr('{0} files (*.{1})', 'ParameterRaster').format(exts[i].upper(), exts[i].lower())
1255-
return ';;'.join(exts)
1256-
elif param.type() == 'table':
1257-
exts = ['csv', 'dbf']
1258-
for i in range(len(exts)):
1259-
exts[i] = self.tr('{0} files (*.{1})', 'ParameterTable').format(exts[i].upper(), exts[i].lower())
1260-
return ';;'.join(exts)
1261-
elif param.type() == 'sink':
1262-
exts = QgsVectorFileWriter.supportedFormatExtensions()
1263-
for i in range(len(exts)):
1264-
exts[i] = self.tr('{0} files (*.{1})', 'ParameterVector').format(exts[i].upper(), exts[i].lower())
1265-
return ';;'.join(exts)
1266-
return ''
1267-
1268-
12691235
class WidgetWrapperFactory:
12701236

12711237
"""

0 commit comments

Comments
 (0)