Fix color output handling
This commit is contained in:
parent
5fb5858802
commit
182e939785
@ -471,21 +471,20 @@ class FileForwarder(threading.Thread):
|
|||||||
self.start()
|
self.start()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.output == 'stdout':
|
if self.output == 'stdout' and self.color is not False:
|
||||||
while True:
|
while True:
|
||||||
line = self.input.readline()
|
line = self.input.readline()
|
||||||
with self.lock:
|
with self.lock:
|
||||||
cprint.cout(self.color, line, -1)
|
cprint.cout(self.color, line, -1)
|
||||||
elif self.output == 'stderr':
|
elif self.output == 'stderr' and self.color is not False:
|
||||||
while True:
|
while True:
|
||||||
line = self.input.readline()
|
line = self.input.readline()
|
||||||
with self.lock:
|
with self.lock:
|
||||||
cprint.cerr(self.color, line, -1)
|
cprint.cerr(self.color, line, -1)
|
||||||
else:
|
else:
|
||||||
|
if isinstance(self.output, str):
|
||||||
|
self.output = getattr(sys, self.output)
|
||||||
while True:
|
while True:
|
||||||
line = self.input.readline()
|
line = self.input.readline()
|
||||||
with self.lock:
|
with self.lock:
|
||||||
self.output.write(line)
|
self.output.write(line)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user