From 1358664af2c27db4d7d62292680013e811f11750 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 21 Jul 2009 21:53:36 +0200 Subject: python/progress.cc: Introduce setattr to reduce code duplication. This way, we can replace stuff like PyObject *o = PyBuildValue("i", 0); PyObject_SetAttrString(callbackInst, "attribute", o); Py_DECREF(o) with setattr(callbackInst,"attribute","i",0); --- python/progress.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python/progress.h') diff --git a/python/progress.h b/python/progress.h index 88c0a21b..e92933a7 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 @@ -63,6 +63,7 @@ typedef struct { } PyAcquireProgressObject; + class PyCallbackObj { protected: PyObject *callbackInst; -- cgit v1.2.3