summaryrefslogtreecommitdiff
path: root/python/progress.h
diff options
context:
space:
mode:
Diffstat (limited to 'python/progress.h')
-rw-r--r--python/progress.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/python/progress.h b/python/progress.h
index 29243bfc..80cb2785 100644
--- a/python/progress.h
+++ b/python/progress.h
@@ -18,7 +18,7 @@
/* PyCbObj_BEGIN_ALLOW_THREADS and PyCbObj_END_ALLOW_THREADS are sligthly
* modified versions of Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS.
* Instead of storing the thread state in a function-local variable these
- * use a class attribute (with the same) name, allowing blocking and
+ * use a class attribute (with the same) name, allowing blocking and
* unblocking from different class methods.
* Py_BLOCK_THREADS and Py_UNBLOCK_THREADS do not define their own
* local variable but use the one provided by PyCbObj_BEGIN_ALLOW_THREADS
@@ -62,6 +62,9 @@ struct PyOpProgress : public OpProgress, public PyCallbackObj
struct PyFetchProgress : public pkgAcquireStatus, public PyCallbackObj
{
+ protected:
+ PyObject *pyAcquire;
+ public:
enum {
DLDone, DLQueued, DLFailed, DLHit, DLIgnored
};
@@ -70,6 +73,10 @@ struct PyFetchProgress : public pkgAcquireStatus, public PyCallbackObj
virtual bool MediaChange(string Media, string Drive);
+ void setPyAcquire(PyObject *o) {
+ pyAcquire = o;
+ }
+
/* apt stuff */
virtual void IMSHit(pkgAcquire::ItemDesc &Itm);
virtual void Fetch(pkgAcquire::ItemDesc &Itm);