summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-02-02 17:59:22 +0100
committerJulian Andres Klode <jak@debian.org>2010-02-02 17:59:22 +0100
commit3827ac6144cc4beda932a7602e66e4286a3e4265 (patch)
treea932fc558d17a6fb107fd491c664da2981d15db7 /python
parent7516fccf52d03722a61a34b1e36f90808670c754 (diff)
downloadpython-apt-3827ac6144cc4beda932a7602e66e4286a3e4265.tar.gz
python: Update PyAcquire_FromCpp to the new API rules (add Owner parameter).
Diffstat (limited to 'python')
-rw-r--r--python/acquire.cc4
-rw-r--r--python/apt_pkgmodule.h3
-rw-r--r--python/progress.cc4
-rw-r--r--python/python-apt.h2
4 files changed, 7 insertions, 6 deletions
diff --git a/python/acquire.cc b/python/acquire.cc
index 04e00b02..5e22280e 100644
--- a/python/acquire.cc
+++ b/python/acquire.cc
@@ -324,8 +324,8 @@ static PyObject *PkgAcquireNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
/**
* Create a new apt_pkg.Acquire Python object from the pkgAcquire object.
*/
-PyObject *PyAcquire_FromCpp(pkgAcquire *fetcher, bool Delete) {
- CppPyObject<pkgAcquire*> *obj = CppPyObject_NEW<pkgAcquire*>(NULL, &PyAcquire_Type, fetcher);
+PyObject *PyAcquire_FromCpp(pkgAcquire *fetcher, bool Delete, PyObject *owner) {
+ CppPyObject<pkgAcquire*> *obj = CppPyObject_NEW<pkgAcquire*>(owner, &PyAcquire_Type, fetcher);
obj->NoDelete = (!Delete);
return obj;
}
diff --git a/python/apt_pkgmodule.h b/python/apt_pkgmodule.h
index 3dcf8069..da647c3f 100644
--- a/python/apt_pkgmodule.h
+++ b/python/apt_pkgmodule.h
@@ -134,7 +134,7 @@ extern PyTypeObject PySystemLock_Type;
extern PyTypeObject PyFileLock_Type;
// Functions to be exported in the public API.
-PyObject *PyAcquire_FromCpp(pkgAcquire *fetcher, bool Delete);
+
# define PyAcquire_ToCpp GetCpp<pkgAcquire*>
# define PyAcquireFile_ToCpp GetCpp<pkgAcqFile*>
# define PyAcquireItem_ToCpp GetCpp<pkgAcquire::Item*>
@@ -167,6 +167,7 @@ PyObject *PyAcquire_FromCpp(pkgAcquire *fetcher, bool Delete);
# define PyTagSection_ToCpp GetCpp<pkgTagSection>
# define PyVersion_ToCpp GetCpp<pkgCache::VerIterator>
+PyObject* PyAcquire_FromCpp(pkgAcquire *fetcher, bool Delete, PyObject *Owner);
PyObject* PyAcquireFile_FromCpp(pkgAcqFile* const &obj, bool Delete, PyObject *Owner);
PyObject* PyAcquireItem_FromCpp(pkgAcquire::Item* const &obj, bool Delete, PyObject *Owner);
PyObject* PyAcquireItemDesc_FromCpp(pkgAcquire::ItemDesc* const &obj, bool Delete, PyObject *Owner);
diff --git a/python/progress.cc b/python/progress.cc
index b69149d5..bedad935 100644
--- a/python/progress.cc
+++ b/python/progress.cc
@@ -119,7 +119,7 @@ void PyOpProgress::Done()
PyObject *PyFetchProgress::GetDesc(pkgAcquire::ItemDesc *item) {
if (!pyAcquire && item->Owner && item->Owner->GetOwner()) {
- pyAcquire = PyAcquire_FromCpp(item->Owner->GetOwner(), false);
+ pyAcquire = PyAcquire_FromCpp(item->Owner->GetOwner(), false, NULL);
}
PyObject *pyItem = PyAcquireItem_FromCpp(item->Owner, false, pyAcquire);
PyObject *pyDesc = PyAcquireItemDesc_FromCpp(item, false, pyItem);
@@ -295,7 +295,7 @@ bool PyFetchProgress::Pulse(pkgAcquire * Owner)
bool res1 = true;
if (pyAcquire == NULL) {
- pyAcquire = PyAcquire_FromCpp(Owner, false);
+ pyAcquire = PyAcquire_FromCpp(Owner, false, NULL);
}
Py_INCREF(pyAcquire);
diff --git a/python/python-apt.h b/python/python-apt.h
index 0c25ff02..b9fc9212 100644
--- a/python/python-apt.h
+++ b/python/python-apt.h
@@ -43,7 +43,7 @@ typedef pkgDepCache::ActionGroup*& ActionGroupT(PyObject *self);
struct _PyAptPkgAPIStruct {
// apt_pkg.Acquire (pkgAcquire*)
PyTypeObject *acquire_type;
- PyObject* (*acquire_fromcpp)(pkgAcquire *acquire, bool Delete);
+ PyObject* (*acquire_fromcpp)(pkgAcquire *acquire, bool Delete, PyObject*);
pkgAcquire*& (*acquire_tocpp)(PyObject *self);
// apt_pkg.AcquireFile
PyTypeObject *acquirefile_type;