From 67b5de8d0564a0f349766ffa26ffbcc5a6fdab6e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 31 Mar 2005 11:41:46 +0000 Subject: * debcache has a "Packages" attribute now too (like the cache) --- python/depcache.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'python/depcache.cc') diff --git a/python/depcache.cc b/python/depcache.cc index 4bd1f390..9c302b40 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -21,6 +21,7 @@ #include #include "progress.h" +#include "cache.h" // DepCache Class /*{{{*/ // --------------------------------------------------------------------- @@ -295,8 +296,12 @@ static PyObject *DepCacheAttr(PyObject *Self,char *Name) { PkgDepCacheStruct &Struct = GetCpp(Self); + // look like a cache + if (strcmp("Packages",Name) == 0) + return CppOwnedPyObject_NEW(Self,&PkgListType, + Struct.depcache->PkgBegin()); // size querries - if(strcmp("KeepCount",Name) == 0) + else if(strcmp("KeepCount",Name) == 0) return Py_BuildValue("l", Struct.depcache->KeepCount()); else if(strcmp("InstCount",Name) == 0) return Py_BuildValue("l", Struct.depcache->InstCount()); -- cgit v1.2.3