Skip to content
Permalink
Browse files

[processing] fixed last commit

  • Loading branch information
volaya committed Jul 24, 2017
1 parent 3ee5d18 commit ab6dd7447e5193b3d08c172563594dc3e36cdc29
Showing with 4 additions and 5 deletions.
  1. +4 −5 python/plugins/processing/tools/dataobjects.py
@@ -75,7 +75,7 @@ def getSupportedOutputTableExtensions():

def getRasterLayers(sorting=True):
layers = QgsMapLayerRegistry.instance().mapLayers().values()
raster = [lay.layer() for lay in layers if lay.layer() is not None and canUseRasterLayer(lay.layer())]
raster = [lay for lay in layers if lay is not None and canUseRasterLayer(lay)]
if sorting:
return sorted(raster, key=lambda layer: layer.name().lower())
else:
@@ -84,7 +84,7 @@ def getRasterLayers(sorting=True):

def getVectorLayers(shapetype=[-1], sorting=True):
layers = QgsMapLayerRegistry.instance().mapLayers().values()
vector = [lay.layer() for lay in layers if canUseVectorLayer(lay.layer(), shapetype)]
vector = [lay for lay in layers if canUseVectorLayer(lay, shapetype)]
if sorting:
return sorted(vector, key=lambda layer: layer.name().lower())
else:
@@ -118,9 +118,8 @@ def getTables(sorting=True):
layers = QgsMapLayerRegistry.instance().mapLayers().values()
tables = []
for layer in layers:
mapLayer = layer.layer()
if mapLayer.type() == QgsMapLayer.VectorLayer:
tables.append(mapLayer)
if layer.type() == QgsMapLayer.VectorLayer:
tables.append(layer)
if sorting:
return sorted(tables, key=lambda table: table.name().lower())
else:

0 comments on commit ab6dd74

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