Skip to content

Commit 0a5bad4

Browse files
committedFeb 1, 2019
[processing] fix broken stdout handling in GRASS algs (fix #21142)
(cherry picked from commit b9f559e)
1 parent f2ceb6e commit 0a5bad4

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed
 

‎python/plugins/processing/algs/grass7/Grass7Algorithm.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,15 +631,13 @@ def processCommand(self, parameters, context, feedback, delOutputs=False):
631631
if outName in parameters and parameters[outName] is not None:
632632
# for HTML reports, we need to redirect stdout
633633
if out.defaultFileExtension().lower() == 'html':
634-
command += ' > "{}"'.format(
635-
self.parameterAsFileOutput(
636-
parameters, outName, context)
637-
)
634+
command += ' {}=- > "{}"'.format(
635+
outName,
636+
self.parameterAsFileOutput(parameters, outName, context))
638637
else:
639638
command += ' {}="{}"'.format(
640639
outName,
641-
self.parameterAsFileOutput(
642-
parameters, outName, context))
640+
self.parameterAsFileOutput(parameters, outName, context))
643641
# For folders destination
644642
elif isinstance(out, QgsProcessingParameterFolderDestination):
645643
# We need to add a unique temporary basename

‎python/plugins/processing/algs/grass7/description/v.net.salesman.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ QgsProcessingParameterNumber|threshold|Threshold for connecting centers to the n
1010
*QgsProcessingParameterField|arc_backward_column|Arc backward direction cost column (number)|None|input|0|False|True
1111
*QgsProcessingParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
1212
QgsProcessingParameterVectorDestination|output|Network_Salesman
13-
QgsProcessingParameterFileDestination|sequence|Output file holding node sequence|Html files (*.html)|report.html|True
13+
QgsProcessingParameterFileDestination|sequence|Output file holding node sequence|CSV files (*.csv)|None|True
1414

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sequence;category;cost_to_next
2+
1;1;0.000
3+
2;2;0.000
4+
3;3;0.000

‎python/plugins/processing/tests/testdata/grass7_algorithms_vector_tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ tests:
280280
output:
281281
name: expected/grass7/v_net_salesman.shp
282282
type: vector
283+
sequence:
284+
name: expected/grass7/v_net_salesman_seq.csv
285+
type: file
283286

284287
- algorithm: grass7:v.net.steiner
285288
name: v.net.steiner

0 commit comments

Comments
 (0)
Please sign in to comment.