diff options
| author | Julian Andres Klode <jak@debian.org> | 2011-04-05 11:27:04 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2011-04-05 11:27:04 +0200 |
| commit | f7adc2d7205e2fdbff7d808e8e4c262b65e3e05d (patch) | |
| tree | 70787e8ed3e60132494261fa9115a978c03fdb96 | |
| parent | 21c9ebb9717ed7b157c697a57d1b6ce3225eb9d6 (diff) | |
| download | python-apt-f7adc2d7205e2fdbff7d808e8e4c262b65e3e05d.tar.gz | |
Add an 'is_multi_arch' attribute to apt_pkg.Cache
| -rw-r--r-- | debian/changelog | 1 | ||||
| -rw-r--r-- | doc/source/library/apt_pkg.rst | 4 | ||||
| -rw-r--r-- | python/cache.cc | 7 |
3 files changed, 12 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 5dd9d69e..48ce8f71 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ python-apt (0.8.0~exp1) UNRELEASED; urgency=low * Disable the old-style API, and break all packages using it + * Add an 'is_multi_arch' attribute to apt_pkg.Cache -- Julian Andres Klode <jak@debian.org> Tue, 05 Apr 2011 10:33:54 +0200 diff --git a/doc/source/library/apt_pkg.rst b/doc/source/library/apt_pkg.rst index 426cb97e..16593fe8 100644 --- a/doc/source/library/apt_pkg.rst +++ b/doc/source/library/apt_pkg.rst @@ -73,6 +73,10 @@ Working with the cache A list of all :class:`PackageFile` objects stored in the cache. + .. attribute:: is_multi_arch + + An attribute determining whether the cache supports multi-arch. + .. attribute:: package_count The total number of packages available in the cache. This value is diff --git a/python/cache.cc b/python/cache.cc index 190d4f27..b5ebcce4 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -222,11 +222,18 @@ static PyObject *PkgCacheGetFileList(PyObject *Self, void*) { return List; } +static PyObject *PkgCacheGetIsMultiArch(PyObject *Self, void*) { + pkgCache *Cache = GetCpp<pkgCache *>(Self); + PyBool_FromLong(Cache->MultiArchCache()); +} + static PyGetSetDef PkgCacheGetSet[] = { {"depends_count",PkgCacheGetDependsCount,0, "The number of apt_pkg.Dependency objects stored in the cache."}, {"file_list",PkgCacheGetFileList,0, "A list of apt_pkg.PackageFile objects stored in the cache."}, + {"is_multi_arch", PkgCacheGetIsMultiArch, 0, + "Whether the cache supports multi-arch."}, {"package_count",PkgCacheGetPackageCount,0, "The number of apt_pkg.Package objects stored in the cache."}, {"package_file_count",PkgCacheGetPackageFileCount,0, |
