Support python 3
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
17682c58db
commit
809443d6d0
23 changed files with 128 additions and 85 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import codecs
|
||||
import json
|
||||
import os
|
||||
|
||||
import six
|
||||
|
||||
|
||||
class StreamOutputError(Exception):
|
||||
|
|
@ -8,8 +9,9 @@ class StreamOutputError(Exception):
|
|||
|
||||
|
||||
def stream_output(output, stream):
|
||||
is_terminal = hasattr(stream, 'fileno') and os.isatty(stream.fileno())
|
||||
stream = codecs.getwriter('utf-8')(stream)
|
||||
is_terminal = hasattr(stream, 'isatty') and stream.isatty()
|
||||
if not six.PY3:
|
||||
stream = codecs.getwriter('utf-8')(stream)
|
||||
all_events = []
|
||||
lines = {}
|
||||
diff = 0
|
||||
|
|
@ -55,7 +57,6 @@ def print_output_event(event, stream, is_terminal):
|
|||
# erase current line
|
||||
stream.write("%c[2K\r" % 27)
|
||||
terminator = "\r"
|
||||
pass
|
||||
elif 'progressDetail' in event:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue