diff options
Diffstat (limited to 'apt/progress')
| -rw-r--r-- | apt/progress/gtk2.py | 8 | ||||
| -rw-r--r-- | apt/progress/text.py | 9 |
2 files changed, 9 insertions, 8 deletions
diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py index 63e531fa..b978c34f 100644 --- a/apt/progress/gtk2.py +++ b/apt/progress/gtk2.py @@ -27,6 +27,7 @@ pygtk.require('2.0') import gtk try: import glib + glib # pyflakes except ImportError: import gobject as glib import gobject @@ -87,7 +88,6 @@ class GOpProgress(gobject.GObject, base.OpProgress): self.emit("status-finished") - class GInstallProgress(gobject.GObject, base.InstallProgress): """Installation progress with GObject signals. @@ -241,12 +241,12 @@ class GAcquireProgress(gobject.GObject, base.AcquireProgress): current_item = self.total_items if self.current_cps > 0: text = (_("Downloading file %(current)li of %(total)li with " - "%(speed)s/s") % \ + "%(speed)s/s") % {"current": current_item, "total": self.total_items, "speed": apt_pkg.size_to_str(self.current_cps)}) else: - text = (_("Downloading file %(current)li of %(total)li") % \ + text = (_("Downloading file %(current)li of %(total)li") % {"current": current_item, "total": self.total_items}) @@ -358,7 +358,7 @@ class GtkAptProgress(gtk.VBox): if percent is None or percent == -1: self._progressbar.pulse() else: - self._progressbar.set_fraction(percent/100.0) + self._progressbar.set_fraction(percent / 100.0) while gtk.events_pending(): gtk.main_iteration() diff --git a/apt/progress/text.py b/apt/progress/text.py index c5eec092..76a4309e 100644 --- a/apt/progress/text.py +++ b/apt/progress/text.py @@ -47,7 +47,7 @@ class TextProgress(object): # Fill remaining stuff with whitespace if self._width > len(msg): self._file.write((self._width - len(msg)) * ' ') - elif maximize: # Needed for OpProgress. + elif maximize: # Needed for OpProgress. self._width = max(self._width, len(msg)) if newline: self._file.write("\n") @@ -114,7 +114,7 @@ class AcquireProgress(base.AcquireProgress, TextProgress): import struct buf = fcntl.ioctl(self._file, termios.TIOCGWINSZ, 8 * ' ') dummy, col, dummy, dummy = struct.unpack('hhhh', buf) - self._width = col - 1 # 1 for the cursor + self._width = col - 1 # 1 for the cursor def ims_hit(self, item): """Called when an item is update (e.g. not modified on the server).""" @@ -188,8 +188,9 @@ class AcquireProgress(base.AcquireProgress, TextProgress): # Add the total size and percent if worker.total_size and not worker.current_item.owner.complete: - val += "/%sB %i%%" % (apt_pkg.size_to_str(worker.total_size), - worker.current_size*100.0/worker.total_size) + val += "/%sB %i%%" % ( + apt_pkg.size_to_str(worker.total_size), + worker.current_size * 100.0 / worker.total_size) val += ']' |
