Clean progressbar when needed.
This commit is contained in:
parent
99274cf6d7
commit
34029f56f5
1
macli.py
1
macli.py
@ -189,6 +189,7 @@ def archive_to_dir(directory, url):
|
||||
with open('index.html', 'wt') as f:
|
||||
f.write(archived_content.prettify())
|
||||
|
||||
progbar.clean()
|
||||
os.chdir(current_path)
|
||||
|
||||
|
||||
|
@ -28,3 +28,9 @@ class ProgressBar:
|
||||
def next_iter(self, msg=''):
|
||||
self.current_element += 1
|
||||
self.show(msg)
|
||||
|
||||
def clean(self):
|
||||
print('\r' # Go to the start of the line
|
||||
'\x1b[K' # Clear line
|
||||
'\x1b[0m', # Restart the "style"
|
||||
end='')
|
||||
|
Loading…
Reference in New Issue
Block a user