From 2021c1b4973c3201b1e4580d00b7351c23a831c4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 30 Jan 2012 15:25:37 +0100 Subject: RED: policy should support verfile --- python/cache.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'python') 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(Self,&PyGroupList_Type,Cache->GrpBegin()); } +static PyObject *PkgCacheGetPolicy(PyObject *Self, void*) { + pkgCacheFile *CacheFile = GetCpp(Self); + std::cerr << "policy: " << CacheFile->Policy << std::endl; + return CppPyObject_NEW(Self,&PyPolicy_Type,CacheFile->Policy); +} + static PyObject *PkgCacheGetPackages(PyObject *Self, void*) { pkgCache *Cache = GetCpp(Self); return CppPyObject_NEW(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, -- cgit v1.2.3