From 170c310e75aa0bc417cb67f6e560fdaab482d72e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Jan 2006 23:27:33 +0000 Subject: * added support for pkgIndexFile --- python/sourcelist.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'python/sourcelist.cc') diff --git a/python/sourcelist.cc b/python/sourcelist.cc index 497731c0..16e51368 100644 --- a/python/sourcelist.cc +++ b/python/sourcelist.cc @@ -3,7 +3,7 @@ // $Id: sourcelist.cc,v 1.2 2003/12/26 17:04:22 mdz Exp $ /* ###################################################################### - Package Records - Wrapper for the package records functions + SourcesList - Wrapper for the SourcesList functions ##################################################################### */ /*}}}*/ @@ -16,6 +16,7 @@ #include /*}}}*/ + // PkgsourceList Class /*{{{*/ // --------------------------------------------------------------------- @@ -24,7 +25,24 @@ static char *doc_PkgSourceListFindIndex = "xxx"; static PyObject *PkgSourceListFindIndex(PyObject *Self,PyObject *Args) { pkgSourceList *list = GetCpp(Self); - return Py_BuildValue("i", 1); + PyObject *pyPkgFileIter; + PyObject *pyPkgIndexFile; + + if (PyArg_ParseTuple(Args, "O!", &PackageFileType,&pyPkgFileIter) == 0) + return 0; + + pkgCache::PkgFileIterator &i = GetCpp(pyPkgFileIter); + pkgIndexFile *index; + if(list->FindIndex(i, index)) + { + pyPkgIndexFile = CppOwnedPyObject_NEW(pyPkgFileIter,&PackageIndexFileType,index); + return pyPkgIndexFile; + } + + //&PackageIndexFileType,&pyPkgIndexFile) + + Py_INCREF(Py_None); + return Py_None; } static char *doc_PkgSourceListReadMainList = "xxx"; -- cgit v1.2.3