Skip to content
Permalink
Browse files

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

(cherry-picked from f03baa8)
  • Loading branch information
nyalldawson committed Apr 10, 2018
1 parent 1614638 commit f98a785270207c99794b65eca68e36bbb68faf61
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 f98a785

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