summaryrefslogtreecommitdiffstats
path: root/gio
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-12-30 17:20:35 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2009-12-30 17:20:35 +0100
commit771a7c3fdef7b2e98e509293a8376a81c1282286 (patch)
tree6ea0fd817eaff86fc41d1b12f808dd081a510174 /gio
parent50960656815b0897a5ebe5f011537b8dcbdc857e (diff)
downloadpygobject-771a7c3fdef7b2e98e509293a8376a81c1282286.tar.gz
pygobject-771a7c3fdef7b2e98e509293a8376a81c1282286.tar.xz
pygobject-771a7c3fdef7b2e98e509293a8376a81c1282286.zip
Wrap gio.Socket.condition_wait() and add a test
Diffstat (limited to 'gio')
-rw-r--r--gio/gsocket.override27
1 files changed, 27 insertions, 0 deletions
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);
+}