[Git][reproducible-builds/diffoscope][master] Clear the progress bar after completion. (Closes: #901758)

Chris Lamb gitlab at salsa.debian.org
Fri Jul 6 19:47:39 CEST 2018


Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
68c8263a by Chris Lamb at 2018-07-06T19:47:08+02:00
Clear the progress bar after completion. (Closes: #901758)

- - - - -


1 changed file:

- diffoscope/progress.py


Changes:

=====================================
diffoscope/progress.py
=====================================
--- a/diffoscope/progress.py
+++ b/diffoscope/progress.py
@@ -20,6 +20,7 @@
 import os
 import sys
 import json
+import signal
 import logging
 
 logger = logging.getLogger(__name__)
@@ -219,6 +220,15 @@ class ProgressBar(object):
             def _need_update(self):
                 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=(
             ' ',
             progressbar.Bar(),



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/68c8263a430aca779b0c44fd31e729ae9bd59e0b

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/68c8263a430aca779b0c44fd31e729ae9bd59e0b
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20180706/9f9112cc/attachment.html>


More information about the rb-commits mailing list