Skip to content

Commit cefc4df

Browse files
committedNov 22, 2014
[processing] redirect output from command line tools to Info tab (fix #5618)
1 parent 6637796 commit cefc4df

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed
 

‎python/plugins/processing/algs/gdal/GdalUtils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def runGdal(commands, progress):
6969
loglines = []
7070
loglines.append('GDAL execution console output')
7171
fused_command = ''.join(['%s ' % c for c in commands])
72-
print fused_command
72+
progress.setInfo('GDAL command:')
73+
progress.setCommand(fused_command)
7374
proc = subprocess.Popen(
7475
fused_command,
7576
shell=True,
@@ -78,8 +79,9 @@ def runGdal(commands, progress):
7879
stderr=subprocess.STDOUT,
7980
universal_newlines=True,
8081
).stdout
82+
progress.setInfo('GDAL command output:')
8183
for line in iter(proc.readline, ''):
82-
print line
84+
progress.setConsoleInfo(line)
8385
loglines.append(line)
8486
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)
8587
GdalUtils.consoleOutput = loglines

‎python/plugins/processing/algs/grass/GrassUtils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ def executeGrass(commands, progress, outputCommands=None):
274274
stderr=subprocess.STDOUT,
275275
universal_newlines=True,
276276
).stdout
277+
progress.setInfo('GRASS commands output:')
277278
for line in iter(proc.readline, ''):
278279
if 'GRASS_INFO_PERCENT' in line:
279280
try:

‎python/plugins/processing/algs/taudem/TauDEMUtils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ def executeTauDEM(command, progress):
8282
loglines = []
8383
loglines.append('TauDEM execution console output')
8484
fused_command = ''.join(['"%s" ' % c for c in command])
85+
progress.setInfo('TauDEM command:')
86+
progress.setCommand(fused_command.replace('" "', ' ').strip('"'))
8587
proc = subprocess.Popen(
8688
fused_command,
8789
shell=True,
@@ -91,5 +93,6 @@ def executeTauDEM(command, progress):
9193
universal_newlines=True,
9294
).stdout
9395
for line in iter(proc.readline, ''):
96+
progress.setConsoleInfo(line)
9497
loglines.append(line)
9598
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)

0 commit comments

Comments
 (0)
Please sign in to comment.