]> git.ipfire.org Git - pakfire.git/commitdiff
progressbar: Remove overwriting the Bar class.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Jun 2013 16:51:10 +0000 (18:51 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Jun 2013 16:51:10 +0000 (18:51 +0200)
python/pakfire/util.py

index 84128cd9c7418e4afbadc39e969903a57f40cd23..8d917092e355c29991f2184fd8ef6fe134e61b1c 100644 (file)
@@ -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="]"),
                "  ",
        ]