diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-04 23:27:33 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-04 23:27:33 +0000 |
| commit | 170c310e75aa0bc417cb67f6e560fdaab482d72e (patch) | |
| tree | 7d83888cf413bccbd80b4e5388761c0f66fa20bb /python/sourcelist.cc | |
| parent | 5462bd26c53ed6cddfec2d22a85034db2c786b51 (diff) | |
| download | python-apt-170c310e75aa0bc417cb67f6e560fdaab482d72e.tar.gz | |
* added support for pkgIndexFile
Diffstat (limited to 'python/sourcelist.cc')
| -rw-r--r-- | python/sourcelist.cc | 22 |
1 files changed, 20 insertions, 2 deletions
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 <Python.h> /*}}}*/ + // PkgsourceList Class /*{{{*/ // --------------------------------------------------------------------- @@ -24,7 +25,24 @@ static char *doc_PkgSourceListFindIndex = "xxx"; static PyObject *PkgSourceListFindIndex(PyObject *Self,PyObject *Args) { pkgSourceList *list = GetCpp<pkgSourceList*>(Self); - return Py_BuildValue("i", 1); + PyObject *pyPkgFileIter; + PyObject *pyPkgIndexFile; + + if (PyArg_ParseTuple(Args, "O!", &PackageFileType,&pyPkgFileIter) == 0) + return 0; + + pkgCache::PkgFileIterator &i = GetCpp<pkgCache::PkgFileIterator>(pyPkgFileIter); + pkgIndexFile *index; + if(list->FindIndex(i, index)) + { + pyPkgIndexFile = CppOwnedPyObject_NEW<pkgIndexFile*>(pyPkgFileIter,&PackageIndexFileType,index); + return pyPkgIndexFile; + } + + //&PackageIndexFileType,&pyPkgIndexFile) + + Py_INCREF(Py_None); + return Py_None; } static char *doc_PkgSourceListReadMainList = "xxx"; |
