Create distinct fileinput objects in htmlifier.

* .../logs/htmlify-screen-log.py: fileinput.input is a global attempting
to update it when it is already active causes problems. Instead create
dinstinct FileInput objects for iterating over files to avoid problems
with globals.

Change-Id: I6ac585e55c918b9bcdb188d347049cbb3abb4125
This commit is contained in:
Clark Boylan 2013-08-13 13:04:59 -07:00
parent 5b3b157650
commit 5bb7c62058

View File

@ -81,7 +81,7 @@ def link_timestamp(line):
def passthrough_filter(fname):
for line in fileinput.input(fname, openhook=fileinput.hook_compressed):
for line in fileinput.FileInput(fname, openhook=fileinput.hook_compressed):
yield line
@ -111,7 +111,7 @@ def html_filter(fname):
"""
yield _css_preamble()
for line in fileinput.input(fname, openhook=fileinput.hook_compressed):
for line in fileinput.FileInput(fname, openhook=fileinput.hook_compressed):
newline = escape_html(line)
newline = color_by_sev(newline)
newline = link_timestamp(newline)
@ -122,7 +122,7 @@ def html_filter(fname):
def htmlify_stdin():
out = sys.stdout
out.write(_css_preamble())
for line in fileinput.input():
for line in fileinput.FileInput():
newline = escape_html(line)
newline = color_by_sev(newline)
newline = link_timestamp(newline)