From db9e68fd14345f742211fc293823bff6a2f7d8bd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 Feb 2010 18:18:29 +0100 Subject: apt/progress/base.py: more compat fixes --- apt/progress/base.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apt/progress/base.py b/apt/progress/base.py index 88fee206..ac6ea011 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -28,6 +28,7 @@ import re import select import apt_pkg +from apt.deprecation import function_deprecated_by __all__ = ['AcquireProgress', 'CdromProgress', 'InstallProgress', 'OpProgress'] @@ -158,6 +159,9 @@ 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.""" @@ -222,7 +226,6 @@ class InstallProgress(object): (status, pkgname, percent, status_str) = line.split(":", 3) except ValueError: # silently ignore lines that can't be parsed - self.read = "" return elif line.startswith('status'): try: @@ -281,6 +284,10 @@ class InstallProgress(object): return res + if apt_pkg._COMPAT_0_7: + updateInterface = function_deprecated_by(update_interface) + waitChild = function_deprecated_by(wait_child) + class OpProgress(object): """Monitor objects for operations. -- cgit v1.2.3