From 8ad58480ce8a161519339b41eacefc26059bebf7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 4 Sep 2007 16:28:25 +0200 Subject: * 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/sourcelist.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'python/sourcelist.cc') 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(Self); + + if (strcmp("List",Name) == 0) + { + PyObject *List = PyList_New(0); + for (vector::const_iterator I = list->begin(); + I != list->end(); I++) + { + PyObject *Obj; + Obj = CppPyObject_NEW(&MetaIndexType,*I); + PyList_Append(List,Obj); + } + return List; + } + return Py_FindMethod(PkgSourceListMethods,Self,Name); } PyTypeObject PkgSourceListType = { -- cgit v1.2.3