File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
python/plugins/processing/algs/grass/ext Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 25
25
26
26
__revision__ = '$Format:%H$'
27
27
28
+ import codecs
28
29
29
30
def postProcessResults (alg ):
30
31
htmlFile = alg .getOutputFromName ('html' ).value
31
32
grassName = alg .grassName
32
- found = False
33
- f = open (htmlFile , 'w' )
34
- f .write ('<h2>' + grassName + '</h2>\n ' )
35
- for line in alg .consoleOutput :
36
- if found and not line .strip ().endswith ('exit' ):
37
- f .write (line + '<br>\n ' )
38
- if grassName in line and not line .startswith ('GRASS' ):
39
- found = True
40
- f .close ()
33
+ with codecs .open (htmlFile , 'w' ) as f :
34
+ f .write ('<h2>{}</h2>\n ' .format (grassName ))
35
+ f .write ('<pre>\n ' )
36
+ for line in alg .consoleOutput :
37
+ if not line .startswith ('GRASS' ) and not line .isspace ():
38
+ f .write ('{}\n ' .format (line ))
39
+ f .write ('</pre>\n ' )
You can’t perform that action at this time.
0 commit comments