summaryrefslogtreecommitdiff
path: root/python/progress.cc
diff options
context:
space:
mode:
authorStephan Peijnik <debian@sp.or.at>2009-05-06 22:57:42 +0200
committerStephan Peijnik <debian@sp.or.at>2009-05-06 22:57:42 +0200
commit80f3ac59823b31be89dcb52b5ba38aa27d48121f (patch)
tree521023c930ce6d98962beb7c6737e90a28dc9261 /python/progress.cc
parentc639dfe4d9c77bf7406bb6e4b433c297d293f709 (diff)
parent1b5b026c1013dc20b572a7fd2a690fe451248ab0 (diff)
downloadpython-apt-80f3ac59823b31be89dcb52b5ba38aa27d48121f.tar.gz
Merged with lp:python-apt.
Diffstat (limited to 'python/progress.cc')
-rw-r--r--python/progress.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/python/progress.cc b/python/progress.cc
index a30ea2e7..14948d3c 100644
--- a/python/progress.cc
+++ b/python/progress.cc
@@ -120,7 +120,15 @@ void PyFetchProgress::UpdateStatus(pkgAcquire::ItemDesc &Itm, int status)
Itm.Owner->FileSize,
Itm.Owner->PartialSize);
+ RunSimpleCallback("update_status_full", arglist);
+
+ // legacy version of the interface
+ arglist = Py_BuildValue("(sssi)", Itm.URI.c_str(),
+ Itm.Description.c_str(),
+ Itm.ShortDesc.c_str(),
+ status);
RunSimpleCallback("updateStatus", arglist);
+
}
void PyFetchProgress::IMSHit(pkgAcquire::ItemDesc &Itm)
@@ -274,11 +282,19 @@ bool PyFetchProgress::Pulse(pkgAcquire * Owner)
}
PyObject *result;
+ bool res = true;
+
+ RunSimpleCallback("pulse_items", arglist, &result);
+ if (result != NULL && PyArg_Parse(result, "b", &res) && res == false) {
+ // the user returned a explicit false here, stop
+ return false;
+ }
+
+ arglist = Py_BuildValue("()");
if (!RunSimpleCallback("pulse", arglist, &result)) {
return true;
}
- bool res = true;
if((result == NULL) || (!PyArg_Parse(result, "b", &res)))
{
// most of the time the user who subclasses the pulse()