From 9e5bfd3bc00a88094e6d16dcce6f50a0f51a5ee6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Oct 2006 16:54:00 +0200 Subject: * python/tag.cc: - fix another PyMem_DEL() -> PyObject_DEL() error --- python/tag.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/tag.cc b/python/tag.cc index 883a8eab..d0d862c9 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -68,7 +68,7 @@ void TagFileFree(PyObject *Obj) Self->Object.~pkgTagFile(); Self->Fd.~FileFd(); Py_DECREF(Self->File); - PyMem_DEL(Obj); + PyObject_DEL(Obj); } /*}}}*/ -- cgit v1.2.3 From 053d66916010f0f4e2b234c6bbd93e0afe79631e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Oct 2006 17:00:42 +0200 Subject: * python/configuration.cc: - and the final(!?!) incorrect PyMem_{DEL,Free} usage --- python/configuration.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/configuration.cc b/python/configuration.cc index 6cf33581..55eac1bf 100644 --- a/python/configuration.cc +++ b/python/configuration.cc @@ -490,7 +490,7 @@ PyTypeObject ConfigurationPtrType = sizeof(CppPyObject), // tp_basicsize 0, // tp_itemsize // Methods - (destructor)PyMem_Free, // tp_dealloc + (destructor)PyObject_Free, // tp_dealloc 0, // tp_print CnfGetAttr, // tp_getattr 0, // tp_setattr -- cgit v1.2.3 From 0d6bdd9d329f6527f6a5f2337828e03c2e2af508 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 6 Oct 2006 17:22:40 +0200 Subject: * python/depcache.cc: - suport for pkgActionGrup added --- debian/changelog | 2 +- python/depcache.cc | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/debian/changelog b/debian/changelog index d9b428bd..b1099dea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,7 +10,7 @@ python-apt (0.6.19) unstable; urgency=low - fix commit doc string to also cite the open related callbacks - allow change of rootdir for APT database loading - -- + -- Michael Vogt Tue, 27 Jun 2006 16:51:56 +0200 python-apt (0.6.18) unstable; urgency=low diff --git a/python/depcache.cc b/python/depcache.cc index 60bbc1a4..159a7103 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -745,3 +745,73 @@ PyTypeObject PkgProblemResolverType = }; /*}}}*/ + +// pkgActionGroup Class /*{{{*/ +// --------------------------------------------------------------------- + + +static PyObject *PkgActionGroupRelease(PyObject *Self,PyObject *Args) +{ + pkgDepCache::ActionGroup *ag = GetCpp(Self); + if (PyArg_ParseTuple(Args,"") == 0) + return 0; + ag->release(); + Py_INCREF(Py_None); + return HandleErrors(Py_None); +} + +static PyMethodDef PkgActionGroupMethods[] = +{ + {"release", PkgActionGroupRelease, METH_VARARGS, "release()"}, + {} +}; + + +static PyObject *ActionGroupAttr(PyObject *Self,char *Name) +{ + pkgDepCache::ActionGroup *ag = GetCpp(Self); + + return Py_FindMethod(PkgActionGroupMethods,Self,Name); +} + + +PyTypeObject PkgActionGroupType = +{ + PyObject_HEAD_INIT(&PyType_Type) + 0, // ob_size + "pkgActionGroup", // tp_name + sizeof(CppOwnedPyObject), // tp_basicsize + 0, // tp_itemsize + // Methods + CppOwnedDealloc, // tp_dealloc + 0, // tp_print + ActionGroupAttr, // tp_getattr + 0, // tp_setattr + 0, // tp_compare + 0, // tp_repr + 0, // tp_as_number + 0, // tp_as_sequence + 0, // tp_as_mapping + 0, // tp_hash +}; + +PyObject *GetPkgActionGroup(PyObject *Self,PyObject *Args) +{ + PyObject *Owner; + if (PyArg_ParseTuple(Args,"O!",&PkgDepCacheType,&Owner) == 0) + return 0; + + pkgDepCache *depcache = GetCpp(Owner); + pkgDepCache::ActionGroup *group = new pkgDepCache::ActionGroup(*depcache); + CppOwnedPyObject *PkgActionGroupPyObj; + PkgActionGroupPyObj = CppOwnedPyObject_NEW(Owner, + &PkgActionGroupType, + group); + HandleErrors(PkgActionGroupPyObj); + + return PkgActionGroupPyObj; + +} + + + /*}}}*/ -- cgit v1.2.3 From 590401a9f60b47f2fb39c5f3f42c70217ab4f50a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 6 Oct 2006 17:28:31 +0200 Subject: * python/apt_pkgmodule.cc: - *cough* expose the new PkgActionGroup stuff --- python/apt_pkgmodule.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'python') diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index e73628c3..6bd79730 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -392,6 +392,7 @@ static PyMethodDef methods[] = // misc {"GetPkgProblemResolver",GetPkgProblemResolver,METH_VARARGS,"GetDepProblemResolver(DepCache) -> PkgProblemResolver"}, + {"GetPkgActionGroup",GetPkgActionGroup,METH_VARARGS,"GetPkgActionGroup(DepCache) -> PkgActionGroup"}, // Cdrom {"GetCdrom",GetCdrom,METH_VARARGS,"GetCdrom() -> Cdrom"}, -- cgit v1.2.3