Skip to content
Permalink
Browse files

[processing][grass] Don't try to create skipped optional outputs

  • Loading branch information
nyalldawson committed Apr 9, 2018
1 parent c90e783 commit 861c0b2e94003b84328cefac30ada93ebb142749
Showing with 9 additions and 2 deletions.
  1. +9 −2 python/plugins/processing/algs/grass7/Grass7Algorithm.py
@@ -637,6 +637,10 @@ def processOutputs(self, parameters, context, feedback):

for out in self.destinationParameterDefinitions():
outName = out.name()
if not outName in parameters:
# skipped output
continue

if isinstance(out, QgsProcessingParameterRasterDestination):
self.exportRasterLayerFromParameter(outName, parameters, context)
elif isinstance(out, QgsProcessingParameterVectorDestination):
@@ -688,8 +692,11 @@ def exportRasterLayerFromParameter(self, name, parameters, context, colorTable=T
:param context: Algorithm context.
:param colorTable: preserve color Table.
"""
fileName = os.path.normpath(
self.parameterAsOutputLayer(parameters, name, context))
fileName = self.parameterAsOutputLayer(parameters, name, context)
if not fileName:
return

fileName = os.path.normpath(fileName)
grassName = '{}{}'.format(name, self.uniqueSuffix)
outFormat = Grass7Utils.getRasterFormatFromFilename(fileName)
createOpt = self.parameterAsString(parameters, self.GRASS_RASTER_FORMAT_OPT, context)

0 comments on commit 861c0b2

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