summaryrefslogtreecommitdiff
path: root/python/sourcelist.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-12-05 18:34:01 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-12-05 18:34:01 +0000
commitbc7a0801357ecb20535efc3aefad1832274bb29c (patch)
treed51fd91edc20bad5f6d1f51efa7449838c24c654 /python/sourcelist.cc
parentc89b8408c0115e9fccdd4bfe180e93eb746b12cd (diff)
downloadpython-apt-bc7a0801357ecb20535efc3aefad1832274bb29c.tar.gz
* added PkgSourceList.GetIndexes(); rewrote apt.cache.update() to use it
Diffstat (limited to 'python/sourcelist.cc')
-rw-r--r--python/sourcelist.cc17
1 files changed, 17 insertions, 0 deletions
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<pkgSourceList*>(Self);
+
+ PyObject *pyFetcher;
+
+ if (PyArg_ParseTuple(Args, "O!",&PkgAcquireType,&pyFetcher) == 0)
+ return 0;
+
+ pkgAcquire *fetcher = GetCpp<pkgAcquire*>(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},
{}
};