Skip to content
Commits on Source (2)
......@@ -34,9 +34,6 @@ class ProgressLoggingHandler(logging.StreamHandler):
def emit(self, record):
try:
# Delete the current line (i.e. the progress bar)
self.stream.write("\r\033[K")
self.flush()
super().emit(record)
if not self.progressbar.bar.finished:
self.progressbar.bar.update()
......@@ -232,10 +229,8 @@ class ProgressBar(object):
if self.erase_to_eol:
self.fd.buffer.write(self.erase_to_eol)
elif self.fd.isatty():
from shutil import get_terminal_size
width = get_terminal_size().columns
print(end='\r', file=self.fd)
print(' ' * width, end='', file=self.fd)
print(' ' * self.term_width, end='', file=self.fd)
else:
# Do not flush if nothing was written
return
......