mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
[processing] fix GRASS output parser (fix #10660)
This commit is contained in:
parent
72fe56cfe4
commit
b2ba8e9c85
@ -25,16 +25,15 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
|
||||
__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')
|
||||
with codecs.open(htmlFile, 'w') as f:
|
||||
f.write('<h2>{}</h2>\n'.format(grassName))
|
||||
f.write('<pre>\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()
|
||||
if not line.startswith('GRASS') and not line.isspace():
|
||||
f.write('{}\n'.format(line))
|
||||
f.write('</pre>\n')
|
||||
|
Loading…
x
Reference in New Issue
Block a user