diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-11-18 11:23:10 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-11-18 11:23:10 +0000 |
| commit | a56d4330c45ea9dbb9dd8babb7e8f17ae79a6fdd (patch) | |
| tree | 1fabe39aa01711733a75403a9257e7bd14dc53b3 /python/acquire.cc | |
| parent | c187e828e1661d09a8437214b2f90dcc25c05c99 (diff) | |
| download | python-apt-a56d4330c45ea9dbb9dd8babb7e8f17ae79a6fdd.tar.gz | |
* acquire interface works with progress reporting now
Diffstat (limited to 'python/acquire.cc')
| -rw-r--r-- | python/acquire.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/python/acquire.cc b/python/acquire.cc index 550deb0e..ff01b659 100644 --- a/python/acquire.cc +++ b/python/acquire.cc @@ -9,6 +9,7 @@ #include "generic.h" #include "apt_pkgmodule.h" #include "acquire.h" +#include "progress.h" #include <apt-pkg/acquire-item.h> @@ -92,7 +93,20 @@ PyTypeObject PkgAcquireType = PyObject *GetAcquire(PyObject *Self,PyObject *Args) { - pkgAcquire *fetcher = new pkgAcquire(); + pkgAcquire *fetcher; + + PyObject *pyFetchProgressInst = NULL; + if (PyArg_ParseTuple(Args,"|O",&pyFetchProgressInst) == 0) + return 0; + + if (pyFetchProgressInst != NULL) { + // FIXME: memleak? + PyFetchProgress *progress = new PyFetchProgress(); + progress->setCallbackInst(pyFetchProgressInst); + fetcher = new pkgAcquire(progress); + } else { + fetcher = new pkgAcquire(); + } CppOwnedPyObject<pkgAcquire> *FetcherObj = CppOwnedPyObject_NEW<pkgAcquire>(0,&PkgAcquireType, *fetcher); |
