From bc7a0801357ecb20535efc3aefad1832274bb29c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 5 Dec 2005 18:34:01 +0000 Subject: * added PkgSourceList.GetIndexes(); rewrote apt.cache.update() to use it --- python/sourcelist.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'python') diff --git a/python/sourcelist.cc b/python/sourcelist.cc index 4eed21a7..497731c0 100644 --- a/python/sourcelist.cc +++ b/python/sourcelist.cc @@ -36,10 +36,27 @@ static PyObject *PkgSourceListReadMainList(PyObject *Self,PyObject *Args) return HandleErrors(Py_BuildValue("b",res)); } +static char *doc_PkgSourceListGetIndexes = "Load the indexes into the fetcher"; +static PyObject *PkgSourceListGetIndexes(PyObject *Self,PyObject *Args) +{ + pkgSourceList *list = GetCpp(Self); + + PyObject *pyFetcher; + + if (PyArg_ParseTuple(Args, "O!",&PkgAcquireType,&pyFetcher) == 0) + return 0; + + pkgAcquire *fetcher = GetCpp(pyFetcher); + bool res = list->GetIndexes(fetcher); + + return HandleErrors(Py_BuildValue("b",res)); +} + static PyMethodDef PkgSourceListMethods[] = { {"FindIndex",PkgSourceListFindIndex,METH_VARARGS,doc_PkgSourceListFindIndex}, {"ReadMainList",PkgSourceListReadMainList,METH_VARARGS,doc_PkgSourceListReadMainList}, + {"GetIndexes",PkgSourceListGetIndexes,METH_VARARGS,doc_PkgSourceListReadMainList}, {} }; -- cgit v1.2.3