Skip to content


Make html output in basic stats algorithm optional
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 11, 2017
1 parent cb41ef1 commit e49cc78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions python/plugins/processing/algs/qgis/
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self):'Field to calculate statistics on'),
None, self.INPUT_LAYER, QgsProcessingParameterTableField.Any))

self.addParameter(QgsProcessingParameterFileOutput(self.OUTPUT_HTML_FILE,'Statistics'),'HTML files (*.html)')))
self.addParameter(QgsProcessingParameterFileOutput(self.OUTPUT_HTML_FILE,'Statistics'),'HTML files (*.html)'), None, True))

Expand Down Expand Up @@ -149,9 +149,10 @@ def processAlgorithm(self, parameters, context, feedback):
d, results = self.calcStringStats(features, feedback, field, count)

self.createHTML(output_file, data)
if output_file:
self.createHTML(output_file, data)
results[self.OUTPUT_HTML_FILE] = output_file

results[self.OUTPUT_HTML_FILE] = output_file
return results

def calcNumericStats(self, features, feedback, field, count):
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/gui/
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def textChanged(self):

def skipOutput(self):
self.use_temporary = False

def selectOutput(self):
Expand All @@ -99,8 +100,7 @@ def selectOutput(self):
popupMenu = QMenu()

if isinstance(self.parameter, QgsProcessingParameterFeatureSink) \
and self.parameter.flags() & QgsProcessingParameterDefinition.FlagOptional:
if self.parameter.flags() & QgsProcessingParameterDefinition.FlagOptional:
actionSkipOutput = QAction('Skip output'), self.btnSelect)
Expand Down

0 comments on commit e49cc78

Please sign in to comment.