mirror of
https://github.com/verigak/progress.git
synced 2025-12-09 11:45:36 +00:00
Fix Python 3 output
This commit is contained in:
@@ -37,7 +37,7 @@ class WriteMixin(object):
|
|||||||
def write(self, s):
|
def write(self, s):
|
||||||
if self.file.isatty():
|
if self.file.isatty():
|
||||||
b = '\b' * self._width
|
b = '\b' * self._width
|
||||||
c = s.encode('utf8').ljust(self._width)
|
c = s.ljust(self._width)
|
||||||
print(b + c, end='', file=self.file)
|
print(b + c, end='', file=self.file)
|
||||||
self._width = max(self._width, len(s))
|
self._width = max(self._width, len(s))
|
||||||
self.file.flush()
|
self.file.flush()
|
||||||
@@ -65,7 +65,7 @@ class WritelnMixin(object):
|
|||||||
def writeln(self, line):
|
def writeln(self, line):
|
||||||
if self.file.isatty():
|
if self.file.isatty():
|
||||||
self.clearln()
|
self.clearln()
|
||||||
print(line.encode('utf8'), end='', file=self.file)
|
print(line, end='', file=self.file)
|
||||||
self.file.flush()
|
self.file.flush()
|
||||||
|
|
||||||
def finish(self):
|
def finish(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user