mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[processing] fix broken stdout handling in GRASS algs (fix #21142)
This commit is contained in:
parent
a911ef3367
commit
b9f559ee04
@ -631,15 +631,13 @@ class Grass7Algorithm(QgsProcessingAlgorithm):
|
||||
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
|
||||
|
@ -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
|
||||
|
||||
|
4
python/plugins/processing/tests/testdata/expected/grass7/v_net_salesman_seq.csv
vendored
Normal file
4
python/plugins/processing/tests/testdata/expected/grass7/v_net_salesman_seq.csv
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
sequence;category;cost_to_next
|
||||
1;1;0.000
|
||||
2;2;0.000
|
||||
3;3;0.000
|
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user