From 0d4e95621e05d50cd454049a424bb9ee098a5db6 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 19 May 2016 15:53:19 +0200 Subject: python: Improve progress callbacks. * lang/python/helpers.c (pyProgressCb): Stash python errors, convert 'what' to Unicode object. * lang/python/pyme/core.py (Context.set_progress_cb): Hand in 'self'. * lang/python/tests/t-callbacks.py: Test progress callbacks. Signed-off-by: Justus Winter --- lang/python/pyme/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lang/python/pyme/core.py') diff --git a/lang/python/pyme/core.py b/lang/python/pyme/core.py index 8a4c197e..9e7faf77 100644 --- a/lang/python/pyme/core.py +++ b/lang/python/pyme/core.py @@ -185,9 +185,9 @@ class Context(GpgmeWrapper): else: self.last_progresscb = pygpgme.new_PyObject_p_p() if hook == None: - hookdata = func + hookdata = (self, func) else: - hookdata = (func, hook) + hookdata = (self, func, hook) pygpgme.pygpgme_set_progress_cb(self.wrapped, hookdata, self.last_progresscb) def get_engine_info(self): -- cgit v1.2.3