From 771a7c3fdef7b2e98e509293a8376a81c1282286 Mon Sep 17 00:00:00 2001 From: Gian Mario Tagliaretti Date: Wed, 30 Dec 2009 17:20:35 +0100 Subject: Wrap gio.Socket.condition_wait() and add a test --- gio/gsocket.override | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gio') diff --git a/gio/gsocket.override b/gio/gsocket.override index 2f009fc..d2283bb 100644 --- a/gio/gsocket.override +++ b/gio/gsocket.override @@ -39,3 +39,30 @@ _wrap_g_socket_condition_check(PyGObject *self, return pyg_flags_from_gtype(G_TYPE_IO_CONDITION, ret); } +%% +override g_socket_condition_wait kwargs +static PyObject * +_wrap_g_socket_condition_wait(PyGObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "condition", "cancellable", NULL }; + gboolean ret; + gint condition; + PyGObject *py_cancellable = NULL; + GCancellable *cancellable; + GError *error; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, + "i|O:gio.Socket.condition_wait", + kwlist, &condition, &cancellable)) + return NULL; + + if (!pygio_check_cancellable(py_cancellable, &cancellable)) + return NULL; + + ret = g_socket_condition_wait(G_SOCKET(self->obj), condition, + cancellable, &error); + + return PyBool_FromLong(ret); +} -- cgit