[maemo-commits] [maemo-commits] r9991 - in projects/haf/trunk/python-osso: debian src
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Fri Feb 16 19:52:27 EET 2007
- Previous message: [maemo-commits] r9990 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r9992 - projects/haf/tags/apt
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: luciano Date: 2007-02-16 19:52:22 +0200 (Fri, 16 Feb 2007) New Revision: 9991 Modified: projects/haf/trunk/python-osso/debian/changelog projects/haf/trunk/python-osso/src/osso-helper.c projects/haf/trunk/python-osso/src/osso-rpc.c Log: Bugfix: rpc_run, rpc_async_run and callback function Modified: projects/haf/trunk/python-osso/debian/changelog =================================================================== --- projects/haf/trunk/python-osso/debian/changelog 2007-02-16 16:55:30 UTC (rev 9990) +++ projects/haf/trunk/python-osso/debian/changelog 2007-02-16 17:52:22 UTC (rev 9991) @@ -1,3 +1,12 @@ +python-osso (0.3-1osso1) unstable; urgency=low + + * Osso rpc functions revised: + - rpc_run and rpc_async_run now can send correctly rpc arguments + - callback function of rpc_async_run now has an extra param: retval + eg: def callbackfunc (interface, method, retval, userdata): + + -- Luciano Miguel Wolf <luciano.wolf at indt.org.br> Fri, 16 Jan 2007 14:50:00 -0300 + python-osso (0.2-1osso1) unstable; urgency=low * Osso split in small modules Modified: projects/haf/trunk/python-osso/src/osso-helper.c =================================================================== --- projects/haf/trunk/python-osso/src/osso-helper.c 2007-02-16 16:55:30 UTC (rev 9990) +++ projects/haf/trunk/python-osso/src/osso-helper.c 2007-02-16 17:52:22 UTC (rev 9991) @@ -168,7 +168,7 @@ } for (i = 0; i < size; i++) { - arg = g_array_index(args, osso_rpc_t *, i); + arg = &g_array_index(args, osso_rpc_t, i); py_arg = _rpc_t_to_python(arg); PyTuple_SetItem(ret, i, py_arg); } Modified: projects/haf/trunk/python-osso/src/osso-rpc.c =================================================================== --- projects/haf/trunk/python-osso/src/osso-rpc.c 2007-02-16 16:55:30 UTC (rev 9990) +++ projects/haf/trunk/python-osso/src/osso-rpc.c 2007-02-16 17:52:22 UTC (rev 9991) @@ -348,12 +348,12 @@ if (rpc_async_callback == NULL) { return; } - - py_args = Py_BuildValue("(ssO)", interface, method, data); + + py_args = Py_BuildValue("(ssOO)", interface, method, _rpc_t_to_python(retval), data); py_ret = PyEval_CallObject(rpc_async_callback, py_args); - _python_to_rpc_t(py_ret, retval); - + Py_DECREF(py_args); + Py_DECREF(py_ret); PyGILState_Release(state); return; } @@ -366,8 +366,8 @@ char *object_path; char *interface; char *method; - PyObject *py_func; - PyObject *py_data; + PyObject *py_func = NULL; + PyObject *py_data = NULL; PyObject *py_rpc_args = NULL; osso_return_t ret; @@ -382,7 +382,8 @@ &py_rpc_args)) { return NULL; } - + if (py_data == NULL) + py_data = Py_None; /* py_rpc_args */ if (py_rpc_args != NULL) { if (!PyTuple_Check(py_rpc_args)) { @@ -451,6 +452,8 @@ return NULL; } + if (py_data == NULL) + py_data = Py_None; if (py_rpc_args != NULL) { if (!PyTuple_Check(py_rpc_args)) { PyErr_SetString(PyExc_TypeError, @@ -506,7 +509,7 @@ if (set_rpc_callback == NULL) { return OSSO_ERROR; } - + py_args = Py_BuildValue("(ssOO)", interface, method, _rpc_args_c_to_py(arguments), data); py_ret = PyEval_CallObject(set_rpc_callback, py_args); @@ -546,6 +549,8 @@ return NULL; } + if (py_data == NULL) + py_data = Py_None; if (py_func != Py_None) { if (!PyCallable_Check(py_func)) { PyErr_SetString(PyExc_TypeError, "callback parameter must be callable"); @@ -554,20 +559,7 @@ Py_XINCREF(py_func); Py_XDECREF(set_rpc_callback); set_rpc_callback = py_func; - } else { - Py_XDECREF(set_rpc_callback); - set_rpc_callback = NULL; - } - if (py_func != Py_None) { - if (!PyCallable_Check(py_func)) { - PyErr_SetString(PyExc_TypeError, "callback parameter must be callable"); - return NULL; - } - Py_XINCREF(py_func); - Py_XDECREF(set_rpc_callback); - set_rpc_callback = py_func; - ret = osso_rpc_set_cb_f(self->context, service, object_path, interface, _wrap_rpc_callback_handler, py_data); } else { @@ -602,6 +594,8 @@ return NULL; } + if (py_data == NULL) + py_data = Py_None; if (py_func != Py_None) { if (!PyCallable_Check(py_func)) { PyErr_SetString(PyExc_TypeError, "callback parameter must be callable");
- Previous message: [maemo-commits] r9990 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r9992 - projects/haf/tags/apt
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]