summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-03-08 18:20:14 +0100
committerJulian Andres Klode <jak@debian.org>2009-03-08 18:20:14 +0100
commitc3f9f8637176e2411b4e84e632e595cfd5512e90 (patch)
treed89be86277e186826578e48eeff6f4a8c2d8843e
parent5afbd53a5743fe37947d0ebd282111addd325615 (diff)
downloadpython-apt-c3f9f8637176e2411b4e84e632e595cfd5512e90.tar.gz
* apt/cache.py, apt/package.py: Fix some bugs.
-rw-r--r--TODO5
-rw-r--r--apt/cache.py3
-rw-r--r--apt/package.py5
3 files changed, 5 insertions, 8 deletions
diff --git a/TODO b/TODO
index c3faedf4..a08a28af 100644
--- a/TODO
+++ b/TODO
@@ -1,8 +1,3 @@
-* apt.Package:
- - change all candidateInstalledSize() to installSize(useCandidate=True)
- same for candidateOrigin() (see downloadable for a example).
- - might be better to have "Package.candidate.{downloadable,size,etc}
-
* aptsources:
- make the distro detection in sources.list more clever by using the
origin informaton to avoid adding full uris to (unofficial/internal)
diff --git a/apt/cache.py b/apt/cache.py
index 0c729787..1b5531ac 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -20,7 +20,6 @@
# USA
import os
-import sys
import apt_pkg
from apt import Package
@@ -446,7 +445,7 @@ if __name__ == "__main__":
print len(f)
print "Testing filtered cache (no argument)"
- f = FilteredCache(progress=OpTextProgress())
+ f = FilteredCache(progress=apt.progress.OpTextProgress())
f.cache.connect("cache_pre_change", cache_pre_changed)
f.cache.connect("cache_post_change", cache_post_changed)
f.cache.upgrade()
diff --git a/apt/package.py b/apt/package.py
index c9275360..03b1e90c 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -79,6 +79,7 @@ class Dependency(object):
def __repr__(self):
return repr(self.or_dependencies)
+
class DeprecatedProperty(property):
"""A property which gives DeprecationWarning on access.
@@ -97,6 +98,7 @@ class DeprecatedProperty(property):
self.fget.func_name), DeprecationWarning, 2)
return property.__get__(self, obj, type)
+
class Origin(object):
"""The origin of a version.
@@ -167,6 +169,7 @@ class Record(object):
"""deprecated form of 'key in x'."""
return self._rec.has_key(key)
+
class Version(object):
"""Representation of a package version.
@@ -264,7 +267,7 @@ class Version(object):
dsc = unicode(self.package._records.LongDesc, "utf-8")
except UnicodeDecodeError, err:
return _("Invalid unicode in description for '%s' (%s). "
- "Please report.") % (self.name, err)
+ "Please report.") % (self.package.name, err)
lines = iter(dsc.split("\n"))
# Skip the first line, since its a duplication of the summary