From 2b0854638bedee5ef9078be8b3062bfbbd584e7a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 13 Jun 2013 18:51:10 +0200 Subject: [PATCH] progressbar: Remove overwriting the Bar class. --- python/pakfire/util.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/python/pakfire/util.py b/python/pakfire/util.py index 84128cd9..8d917092 100644 --- a/python/pakfire/util.py +++ b/python/pakfire/util.py @@ -79,19 +79,6 @@ def random_string(length=20): return s - -class Bar(progressbar.Bar): - def update(self, pbar, width): - percent = pbar.percentage() - if pbar.finished: - return " " * width - - cwidth = width - len(self.left) - len(self.right) - marked_width = int(percent * cwidth / 100) - m = self._format_marker(pbar) - bar = (self.left + (m*marked_width).ljust(cwidth) + self.right) - return bar - def make_progress(message, maxval, eta=True, speed=False): # Return nothing if stdout is not a terminal. if not sys.stdout.isatty(): @@ -101,7 +88,7 @@ def make_progress(message, maxval, eta=True, speed=False): " ", "%s" % message, " ", - Bar(left="[", right="]"), + progressbar.Bar(left="[", right="]"), " ", ] -- 2.39.2