From 86fea3ed91794aa9537a3b197dbaac500b82f2d8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 22 Nov 2005 11:45:03 +0000 Subject: * python/sourcelist.cc cleaned up --- python/pkgmanager.cc | 9 ++++----- python/sourcelist.cc | 18 ++++++++++-------- python/sourcelist.h | 6 ------ 3 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 python/sourcelist.h (limited to 'python') diff --git a/python/pkgmanager.cc b/python/pkgmanager.cc index 133db755..ce6d35a8 100644 --- a/python/pkgmanager.cc +++ b/python/pkgmanager.cc @@ -9,11 +9,11 @@ #include "generic.h" #include "apt_pkgmodule.h" #include "acquire.h" -#include "sourcelist.h" #include "pkgrecords.h" #include #include +#include #include #include @@ -31,12 +31,11 @@ static PyObject *PkgManagerGetArchives(PyObject *Self,PyObject *Args) return 0; PkgAcquireStruct &s_fetcher = GetCpp(fetcher); - PkgSourceListStruct &s_list = GetCpp(list); + pkgSourceList *s_list = GetCpp(list); PkgRecordsStruct &s_records = GetCpp(recs); - bool res = pm->GetArchives(&s_fetcher.fetcher, - &s_list.List, - &s_records.Records); + bool res = pm->GetArchives(&s_fetcher.fetcher, s_list, + &s_records.Records); return HandleErrors(Py_BuildValue("b",res)); } diff --git a/python/sourcelist.cc b/python/sourcelist.cc index 06cf58a2..2d65062c 100644 --- a/python/sourcelist.cc +++ b/python/sourcelist.cc @@ -10,7 +10,8 @@ // Include Files /*{{{*/ #include "generic.h" #include "apt_pkgmodule.h" -#include "sourcelist.h" + +#include #include /*}}}*/ @@ -22,17 +23,18 @@ static char *doc_PkgSourceListFindIndex = "xxx"; static PyObject *PkgSourceListFindIndex(PyObject *Self,PyObject *Args) { - PkgSourceListStruct &Struct = GetCpp(Self); + pkgSourceList *list = GetCpp(Self); return Py_BuildValue("i", 1); } static char *doc_PkgSourceListReadMainList = "xxx"; static PyObject *PkgSourceListReadMainList(PyObject *Self,PyObject *Args) { - PkgSourceListStruct &Struct = GetCpp(Self); - Struct.List.ReadMainList(); + // PkgSourceListStruct &Struct = GetCpp(Self); + pkgSourceList *list = GetCpp(Self); + bool res = list->ReadMainList(); - return Py_None; + return HandleErrors(Py_BuildValue("b",res)); } static PyMethodDef PkgSourceListMethods[] = @@ -51,10 +53,10 @@ PyTypeObject PkgSourceListType = PyObject_HEAD_INIT(&PyType_Type) 0, // ob_size "pkgSourceList", // tp_name - sizeof(CppPyObject), // tp_basicsize + sizeof(CppPyObject), // tp_basicsize 0, // tp_itemsize // Methods - CppDealloc, // tp_dealloc + CppDealloc, // tp_dealloc 0, // tp_print PkgSourceListAttr, // tp_getattr 0, // tp_setattr @@ -68,6 +70,6 @@ PyTypeObject PkgSourceListType = PyObject *GetPkgSourceList(PyObject *Self,PyObject *Args) { - return CppPyObject_NEW(&PkgSourceListType); + return CppPyObject_NEW(&PkgSourceListType,new pkgSourceList()); } diff --git a/python/sourcelist.h b/python/sourcelist.h deleted file mode 100644 index 98684c54..00000000 --- a/python/sourcelist.h +++ /dev/null @@ -1,6 +0,0 @@ -#include - -struct PkgSourceListStruct -{ - pkgSourceList List; -}; -- cgit v1.2.3