diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-11-07 17:57:50 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-11-07 18:02:05 +0100 |
commit | f6eacfcf1d579242af40820fe284df80c1f2b7bf (patch) | |
tree | 755bba895b037c22b38fe74d7dc8efe1adbab1ac | |
parent | 22d9610a1fd7cf2c1421ec3f63e8e78ffdfd790a (diff) | |
download | samba-f6eacfcf1d579242af40820fe284df80c1f2b7bf.tar.gz samba-f6eacfcf1d579242af40820fe284df80c1f2b7bf.tar.bz2 samba-f6eacfcf1d579242af40820fe284df80c1f2b7bf.zip |
s4:lib/messaging - fix up the python bindings
This fixes up the broken "send" method of the python bindings and corrects some
other parameter lists in parsing functions (this is only cosmetic). The reason
for the bug was a superfluous "|"!
-rw-r--r-- | source4/lib/messaging/pymessaging.c | 11 | ||||
-rw-r--r-- | source4/lib/messaging/tests/bindings.py | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c index 33746af26c..0e6fe88b11 100644 --- a/source4/lib/messaging/pymessaging.c +++ b/source4/lib/messaging/pymessaging.c @@ -138,8 +138,9 @@ static PyObject *py_messaging_send(PyObject *self, PyObject *args, PyObject *kwa const char *kwnames[] = { "target", "msg_type", "data", NULL }; int length; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Ois#|:send", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Ois#:send", discard_const_p(char *, kwnames), &target, &msg_type, &data.data, &length)) { + return NULL; } @@ -176,7 +177,7 @@ static PyObject *py_messaging_register(PyObject *self, PyObject *args, PyObject NTSTATUS status; const char *kwnames[] = { "callback", "msg_type", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:send", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:register", discard_const_p(char *, kwnames), &callback, &msg_type)) { return NULL; } @@ -207,7 +208,7 @@ static PyObject *py_messaging_deregister(PyObject *self, PyObject *args, PyObjec PyObject *callback; const char *kwnames[] = { "callback", "msg_type", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:send", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:deregister", discard_const_p(char *, kwnames), &callback, &msg_type)) { return NULL; } @@ -226,7 +227,7 @@ static PyObject *py_messaging_add_name(PyObject *self, PyObject *args, PyObject char *name; const char *kwnames[] = { "name", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|:send", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|:add_name", discard_const_p(char *, kwnames), &name)) { return NULL; } @@ -247,7 +248,7 @@ static PyObject *py_messaging_remove_name(PyObject *self, PyObject *args, PyObje char *name; const char *kwnames[] = { "name", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|:send", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|:remove_name", discard_const_p(char *, kwnames), &name)) { return NULL; } diff --git a/source4/lib/messaging/tests/bindings.py b/source4/lib/messaging/tests/bindings.py index c89538ddfa..ead7a83afd 100644 --- a/source4/lib/messaging/tests/bindings.py +++ b/source4/lib/messaging/tests/bindings.py @@ -52,6 +52,6 @@ class MessagingTests(TestCase): client_ctx = self.get_context((0, 2)) msg_pong = client_ctx.register(pong_callback) - client_ctx.send((0,1), msg_ping, "testing") - client_ctx.send((0,1), msg_ping, "") + client_ctx.send((0, 1), msg_ping, "testing") + client_ctx.send((0, 1), msg_ping, "") |