summaryrefslogtreecommitdiff
path: root/python/sourcelist.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-11-29 12:25:33 +0100
committerMichael Vogt <egon@bottom>2007-11-29 12:25:33 +0100
commit0fc4aa9466d57ddc4a54191eeb8775e41ad35525 (patch)
tree93b7f4e949c3c013309d397de200d058ec7b5af5 /python/sourcelist.cc
parentbe3ddb25ea0baa259f20936f1d7a62cafa019b99 (diff)
parentabf6c5801c6b162a9dcda5099e8eb746525dc826 (diff)
downloadpython-apt-0fc4aa9466d57ddc4a54191eeb8775e41ad35525.tar.gz
* apt/package.py:
- fix apt.package.Dependency.relation initialization * python/string.cc: - fix overflow in SizeToStr() * 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/depcache.cc: - be more threading friendly * python/tag.cc - support "None" as default in ParseSection(control).get(field, default), LP: #44470 * python/progress.cc: - fix refcount problem in OpProgress - fix refcount problem in FetchProgress - fix refcount problem in CdromProgress * apt/README.apt: - fix typo (thanks to Thomas Schoepf, closes: #387787) * po/fr.po: - merge update, thanks to Christian Perrier (closes: #435918)
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 =
{