diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-31 15:07:32 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-31 15:07:32 +0100 |
| commit | 601d841cc3644f827487a277b5e031323450a6c4 (patch) | |
| tree | be3812288ff3f77ec53de80c5e15ff8429f73578 /python/cache.cc | |
| parent | 9543d9414085ba8f9b29f8b5fe6dca72d6af5fa1 (diff) | |
| parent | 64c1ffa6310efdff6353346fe621aea10e36f2c9 (diff) | |
| download | python-apt-601d841cc3644f827487a277b5e031323450a6c4.tar.gz | |
merged from lp:~mvo/python-apt/mvo
Diffstat (limited to 'python/cache.cc')
| -rw-r--r-- | python/cache.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/python/cache.cc b/python/cache.cc index b263d320..191e2204 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -229,6 +229,12 @@ static PyObject *PkgCacheGetGroups(PyObject *Self, void*) { return CppPyObject_NEW<GrpListStruct>(Self,&PyGroupList_Type,Cache->GrpBegin()); } +static PyObject *PkgCacheGetPolicy(PyObject *Self, void*) { + pkgCacheFile *CacheFile = GetCpp<pkgCacheFile *>(Self); + std::cerr << "policy: " << CacheFile->Policy << std::endl; + return CppPyObject_NEW<pkgPolicy*>(Self,&PyPolicy_Type,CacheFile->Policy); +} + static PyObject *PkgCacheGetPackages(PyObject *Self, void*) { pkgCache *Cache = GetCpp<pkgCache *>(Self); return CppPyObject_NEW<PkgListStruct>(Self,&PyPackageList_Type,Cache->PkgBegin()); @@ -289,6 +295,7 @@ static PyGetSetDef PkgCacheGetSet[] = { {"group_count",PkgCacheGetGroupCount,0, "The number of apt_pkg.Group objects stored in the cache."}, {"groups", PkgCacheGetGroups, 0, "A list of Group objects in the cache"}, + {"policy", PkgCacheGetPolicy, 0, "The PkgPolicy for the cache"}, {"is_multi_arch", PkgCacheGetIsMultiArch, 0, "Whether the cache supports multi-arch."}, {"package_count",PkgCacheGetPackageCount,0, |
