Commit c3f9f863 authored by Julian Andres Klode's avatar Julian Andres Klode

* apt/, apt/ Fix some bugs.

parent 5afbd53a
* 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)
......@@ -20,7 +20,6 @@
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)
......@@ -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.") % (, err)
"Please report.") % (, err)
lines = iter(dsc.split("\n"))
# Skip the first line, since its a duplication of the summary
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment