Commit 68c8263a authored by Chris Lamb's avatar Chris Lamb 💬

Clear the progress bar after completion. (Closes: #901758)

parent a6b4effc
Pipeline #12501 failed with stage
in 9 minutes and 43 seconds
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
import os import os
import sys import sys
import json import json
import signal
import logging import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -219,6 +220,15 @@ class ProgressBar(object): ...@@ -219,6 +220,15 @@ class ProgressBar(object):
def _need_update(self): def _need_update(self):
return True return True
def finish(self):
self.finished = True
self.update(self.maxval)
# Clear the progress bar after completion (#901758)
self.fd.write("\033[K")
self.fd.flush()
if self.signal_set:
signal.signal(signal.SIGWINCH, signal.SIG_DFL)
self.bar = OurProgressBar(widgets=( self.bar = OurProgressBar(widgets=(
' ', ' ',
progressbar.Bar(), progressbar.Bar(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment