From d6343253aa4025376b9a8bb2b2fa140819def747 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 31 Jul 2008 11:22:27 +0200 Subject: * apt/cache.py: - support "in" in apt.Cache() (LP: #251587) --- apt/cache.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt') diff --git a/apt/cache.py b/apt/cache.py index 384afe31..bbf2165b 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -101,6 +101,9 @@ class Cache(object): def has_key(self, key): return self._dict.has_key(key) + def __contains__(self, key): + return key in self._dict + def __len__(self): return len(self._dict) -- cgit v1.2.3 From bf833994a066cba0917c87105db41aa72ebe713a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 18 Sep 2008 14:53:30 +0200 Subject: * apt/package.py: - do not return None in sourcePackageName (LP: #123062) - add "SelState{Unknown,Install,Hold,DeInstall,Purge}" constants --- apt/package.py | 3 ++- debian/changelog | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'apt') diff --git a/apt/package.py b/apt/package.py index 096b1bd1..6300b91a 100644 --- a/apt/package.py +++ b/apt/package.py @@ -186,7 +186,8 @@ class Package(object): def sourcePackageName(self): """ Return the source package name as string """ if not self._lookupRecord(): - return None + if not self._lookupRecord(UseCanidate=False): + return self._pkg.Name src = self._records.SourcePkg if src != "": return src diff --git a/debian/changelog b/debian/changelog index dc9c2501..28335af0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,11 +9,13 @@ python-apt (0.7.8) UNRELEASED; urgency=low - do not change working dir in debExtractArchive() (LP: #184093) * apt/cache.py: - support "in" in apt.Cache() (LP: #251587) + * apt/package.py: + - do not return None in sourcePackageName (LP: #123062) * python/progress.cc: - when pulse() does not return a boolean assume "true" (thanks to Martin Pitt for telling me about the problem) * python/apt_pkgmodule.cc: - add "SelState{Unknown,Install,Hold,DeInstall,Purge}" constants + - add "SelState{Unknown,Install,Hold,DeInstall,Purge}" constants * aptsources/__init__.py, aptsources/distinfo.py: - run apt_pkg.init() when aptsources gets imported and not the distinfo function -- cgit v1.2.3 From 3bc4cc400ef9a6994e3ed51526811bfa2acd9927 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 18 Sep 2008 14:58:03 +0200 Subject: fix typo --- apt/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt') diff --git a/apt/package.py b/apt/package.py index 6300b91a..c1c2b1e1 100644 --- a/apt/package.py +++ b/apt/package.py @@ -186,7 +186,7 @@ class Package(object): def sourcePackageName(self): """ Return the source package name as string """ if not self._lookupRecord(): - if not self._lookupRecord(UseCanidate=False): + if not self._lookupRecord(UseCandidate=False): return self._pkg.Name src = self._records.SourcePkg if src != "": -- cgit v1.2.3