Skip to content
Permalink
Browse files

[processing] fix GRASS output parser (fix #10660)

  • Loading branch information
alexbruy committed Nov 30, 2014
1 parent 72fe56c commit b2ba8e9c8593c31585ce552addc1d6ba85d06437
Showing with 8 additions and 9 deletions.
  1. +8 −9 python/plugins/processing/algs/grass/ext/HtmlReportPostProcessor.py
@@ -25,16 +25,15 @@

__revision__ = '$Format:%H$'

import codecs

def postProcessResults(alg):
htmlFile = alg.getOutputFromName('html').value
grassName = alg.grassName
found = False
f = open(htmlFile, 'w')
f.write('<h2>' + grassName + '</h2>\n')
for line in alg.consoleOutput:
if found and not line.strip().endswith('exit'):
f.write(line + '<br>\n')
if grassName in line and not line.startswith('GRASS'):
found = True
f.close()
with codecs.open(htmlFile, 'w') as f:
f.write('<h2>{}</h2>\n'.format(grassName))
f.write('<pre>\n')
for line in alg.consoleOutput:
if not line.startswith('GRASS') and not line.isspace():
f.write('{}\n'.format(line))
f.write('</pre>\n')

0 comments on commit b2ba8e9

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