diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-03-01 17:48:06 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-03-01 17:48:06 +0100 |
| commit | a8dda6d93b07b7226a3aa41baa50ca059674566e (patch) | |
| tree | 3a47fc78dbdd11c93096409b00212b42341e2e0e /apt/progress | |
| parent | a72f4f9fd0ce0e8c1e49486fd779003b7f05c882 (diff) | |
| download | python-apt-a8dda6d93b07b7226a3aa41baa50ca059674566e.tar.gz | |
Some stylistic changes.
Diffstat (limited to 'apt/progress')
| -rw-r--r-- | apt/progress/base.py | 9 | ||||
| -rw-r--r-- | apt/progress/gtk2.py | 1 | ||||
| -rw-r--r-- | apt/progress/old.py | 10 |
3 files changed, 14 insertions, 6 deletions
diff --git a/apt/progress/base.py b/apt/progress/base.py index d4342de8..6822b74a 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -16,6 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA +# pylint: disable-msg = R0201 """Base classes for progress reporting. Custom progress classes should inherit from these classes. They can also be @@ -28,7 +29,6 @@ import re import select import apt_pkg -from apt.deprecation import function_deprecated_by __all__ = ['AcquireProgress', 'CdromProgress', 'InstallProgress', 'OpProgress'] @@ -137,7 +137,7 @@ class CdromProgress(object): class InstallProgress(object): """Class to report the progress of installing packages.""" - percent, select_timeout, status = 0.0, 0.1, "" + child_pid, percent, select_timeout, status = 0, 0.0, 0.1, "" def __init__(self): (self.statusfd, self.writefd) = os.pipe() @@ -159,9 +159,6 @@ class InstallProgress(object): def status_change(self, pkg, percent, status): """(Abstract) Called when the APT status changed.""" - # compat with 0.7 - if apt_pkg._COMPAT_0_7 and hasattr(self, "statusChange"): - self.statusChange(pkg, percent, status) def dpkg_status_change(self, pkg, status): """(Abstract) Called when the dpkg status changed.""" @@ -269,7 +266,7 @@ class InstallProgress(object): try: select.select([self.status_stream], [], [], self.select_timeout) - except select.error, (errno_, errstr): + except select.error, (errno_, _errstr): if errno_ != errno.EINTR: raise diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py index 29e730a3..acb01eed 100644 --- a/apt/progress/gtk2.py +++ b/apt/progress/gtk2.py @@ -124,6 +124,7 @@ class GInstallProgress(gobject.GObject, base.InstallProgress): base.InstallProgress.__init__(self) gobject.GObject.__init__(self) self.finished = False + self.apt_status = -1 self.time_last_update = time.time() self.term = term reaper = vte.reaper_get() diff --git a/apt/progress/old.py b/apt/progress/old.py index b2f6f0d5..c64eee57 100644 --- a/apt/progress/old.py +++ b/apt/progress/old.py @@ -18,6 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA +# pylint: disable-msg = C0103 """Deprecated progress reporting classes. This module provides classes for compatibility with python-apt 0.7. They are @@ -195,10 +196,19 @@ class InstallProgress(DumbInstallProgress, base.InstallProgress): base.InstallProgress.update_interface) waitChild = function_deprecated_by(base.InstallProgress.wait_child) + def status_change(self, pkg, percent, status): + """(Abstract) Called when the APT status changed.""" + # compat with 0.7 + if apt_pkg._COMPAT_0_7 and hasattr(self, "statusChange"): + self.statusChange(pkg, percent, status) + class DpkgInstallProgress(InstallProgress): """Progress handler for a local Debian package installation.""" + debfile = "" + debname = "" + def run(self, debfile): """Start installing the given Debian package.""" # Deprecated stuff |
