mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -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:
|
if outName in parameters and parameters[outName] is not None:
|
||||||
# for HTML reports, we need to redirect stdout
|
# for HTML reports, we need to redirect stdout
|
||||||
if out.defaultFileExtension().lower() == 'html':
|
if out.defaultFileExtension().lower() == 'html':
|
||||||
command += ' > "{}"'.format(
|
command += ' {}=- > "{}"'.format(
|
||||||
self.parameterAsFileOutput(
|
outName,
|
||||||
parameters, outName, context)
|
self.parameterAsFileOutput(parameters, outName, context))
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
command += ' {}="{}"'.format(
|
command += ' {}="{}"'.format(
|
||||||
outName,
|
outName,
|
||||||
self.parameterAsFileOutput(
|
self.parameterAsFileOutput(parameters, outName, context))
|
||||||
parameters, outName, context))
|
|
||||||
# For folders destination
|
# For folders destination
|
||||||
elif isinstance(out, QgsProcessingParameterFolderDestination):
|
elif isinstance(out, QgsProcessingParameterFolderDestination):
|
||||||
# We need to add a unique temporary basename
|
# 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
|
*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
|
*QgsProcessingParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
|
||||||
QgsProcessingParameterVectorDestination|output|Network_Salesman
|
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:
|
output:
|
||||||
name: expected/grass7/v_net_salesman.shp
|
name: expected/grass7/v_net_salesman.shp
|
||||||
type: vector
|
type: vector
|
||||||
|
sequence:
|
||||||
|
name: expected/grass7/v_net_salesman_seq.csv
|
||||||
|
type: file
|
||||||
|
|
||||||
- algorithm: grass7:v.net.steiner
|
- algorithm: grass7:v.net.steiner
|
||||||
name: v.net.steiner
|
name: v.net.steiner
|
||||||
|
Loading…
x
Reference in New Issue
Block a user