summaryrefslogtreecommitdiff
path: root/python/sourcelist.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-09-04 17:45:41 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-09-04 17:45:41 +0200
commit99f2df941c9b43bc44b02aba43ddcb6463ad129b (patch)
tree1f77e08e893e64d232edd30db496b15d2dbe147d /python/sourcelist.cc
parentbdbe31287e41c11b40924a0d662722b395bddf73 (diff)
parent8ad58480ce8a161519339b41eacefc26059bebf7 (diff)
downloadpython-apt-99f2df941c9b43bc44b02aba43ddcb6463ad129b.tar.gz
* python/metaindex.cc:
- added support for the metaIndex objects * python/sourceslist.cc: - support new "List" attribute that returns the list of metaIndex source entries * python/string.cc: - fix overflow in SizeToStr() * NMU * Fix version to not use CPU and OS since it's not available on APT anymore (closes: #435653, #435674)
Diffstat (limited to 'python/sourcelist.cc')
-rw-r--r--python/sourcelist.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/python/sourcelist.cc b/python/sourcelist.cc
index 16e51368..68b764f8 100644
--- a/python/sourcelist.cc
+++ b/python/sourcelist.cc
@@ -80,7 +80,21 @@ static PyMethodDef PkgSourceListMethods[] =
static PyObject *PkgSourceListAttr(PyObject *Self,char *Name)
{
- return Py_FindMethod(PkgSourceListMethods,Self,Name);
+ pkgSourceList *list = GetCpp<pkgSourceList*>(Self);
+
+ if (strcmp("List",Name) == 0)
+ {
+ PyObject *List = PyList_New(0);
+ for (vector<metaIndex *>::const_iterator I = list->begin();
+ I != list->end(); I++)
+ {
+ PyObject *Obj;
+ Obj = CppPyObject_NEW<metaIndex*>(&MetaIndexType,*I);
+ PyList_Append(List,Obj);
+ }
+ return List;
+ }
+ return Py_FindMethod(PkgSourceListMethods,Self,Name);
}
PyTypeObject PkgSourceListType =
{