Skip to content
Permalink
Browse files

[processing] redirect output from command line tools to Info tab (fix #…

  • Loading branch information
alexbruy committed Nov 22, 2014
1 parent 6637796 commit cefc4df6be865b5dad5f957e0431e755856ba8df
@@ -69,7 +69,8 @@ def runGdal(commands, progress):
loglines = []
loglines.append('GDAL execution console output')
fused_command = ''.join(['%s ' % c for c in commands])
print fused_command
progress.setInfo('GDAL command:')
progress.setCommand(fused_command)
proc = subprocess.Popen(
fused_command,
shell=True,
@@ -78,8 +79,9 @@ def runGdal(commands, progress):
stderr=subprocess.STDOUT,
universal_newlines=True,
).stdout
progress.setInfo('GDAL command output:')
for line in iter(proc.readline, ''):
print line
progress.setConsoleInfo(line)
loglines.append(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)
GdalUtils.consoleOutput = loglines
@@ -274,6 +274,7 @@ def executeGrass(commands, progress, outputCommands=None):
stderr=subprocess.STDOUT,
universal_newlines=True,
).stdout
progress.setInfo('GRASS commands output:')
for line in iter(proc.readline, ''):
if 'GRASS_INFO_PERCENT' in line:
try:
@@ -82,6 +82,8 @@ def executeTauDEM(command, progress):
loglines = []
loglines.append('TauDEM execution console output')
fused_command = ''.join(['"%s" ' % c for c in command])
progress.setInfo('TauDEM command:')
progress.setCommand(fused_command.replace('" "', ' ').strip('"'))
proc = subprocess.Popen(
fused_command,
shell=True,
@@ -91,5 +93,6 @@ def executeTauDEM(command, progress):
universal_newlines=True,
).stdout
for line in iter(proc.readline, ''):
progress.setConsoleInfo(line)
loglines.append(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)

0 comments on commit cefc4df

Please sign in to comment.
You can’t perform that action at this time.