Skip to content

Commit

Permalink
[processing] fix broken stdout handling in GRASS algs (fix #21142)
Browse files Browse the repository at this point in the history
(cherry picked from commit b9f559e)
  • Loading branch information
alexbruy committed Feb 1, 2019
1 parent f2ceb6e commit 0a5bad4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
10 changes: 4 additions & 6 deletions python/plugins/processing/algs/grass7/Grass7Algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,15 +631,13 @@ def processCommand(self, parameters, context, feedback, delOutputs=False):
if outName in parameters and parameters[outName] is not None:
# for HTML reports, we need to redirect stdout
if out.defaultFileExtension().lower() == 'html':
command += ' > "{}"'.format(
self.parameterAsFileOutput(
parameters, outName, context)
)
command += ' {}=- > "{}"'.format(
outName,
self.parameterAsFileOutput(parameters, outName, context))
else:
command += ' {}="{}"'.format(
outName,
self.parameterAsFileOutput(
parameters, outName, context))
self.parameterAsFileOutput(parameters, outName, context))
# For folders destination
elif isinstance(out, QgsProcessingParameterFolderDestination):
# We need to add a unique temporary basename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ QgsProcessingParameterNumber|threshold|Threshold for connecting centers to the n
*QgsProcessingParameterField|arc_backward_column|Arc backward direction cost column (number)|None|input|0|False|True
*QgsProcessingParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
QgsProcessingParameterVectorDestination|output|Network_Salesman
QgsProcessingParameterFileDestination|sequence|Output file holding node sequence|Html files (*.html)|report.html|True
QgsProcessingParameterFileDestination|sequence|Output file holding node sequence|CSV files (*.csv)|None|True

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sequence;category;cost_to_next
1;1;0.000
2;2;0.000
3;3;0.000
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ tests:
output:
name: expected/grass7/v_net_salesman.shp
type: vector
sequence:
name: expected/grass7/v_net_salesman_seq.csv
type: file

- algorithm: grass7:v.net.steiner
name: v.net.steiner
Expand Down

0 comments on commit 0a5bad4

Please sign in to comment.