summaryrefslogtreecommitdiffstats
path: root/gio
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2010-01-01 11:19:34 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2010-01-01 11:19:34 +0100
commita5ab26cc1bb3e9dd57e2fdb26ef5c02e8066d097 (patch)
tree39f0a513c2dba49198eb368cc4c249cb2180fa71 /gio
parentc9496b29ef9ef232020a4044577d2947353953a5 (diff)
downloadpygobject-a5ab26cc1bb3e9dd57e2fdb26ef5c02e8066d097.tar.gz
pygobject-a5ab26cc1bb3e9dd57e2fdb26ef5c02e8066d097.tar.xz
pygobject-a5ab26cc1bb3e9dd57e2fdb26ef5c02e8066d097.zip
Wrap gio.SocketListener.accept_async()
Diffstat (limited to 'gio')
-rw-r--r--gio/gsocket.override42
1 files changed, 42 insertions, 0 deletions
diff --git a/gio/gsocket.override b/gio/gsocket.override
index 12b60a5..9625dfd 100644
--- a/gio/gsocket.override
+++ b/gio/gsocket.override
@@ -350,6 +350,48 @@ _wrap_g_socket_listener_accept(PyGObject *self, PyObject *args, PyObject *kwargs
return Py_BuildValue("(NN)", py_connection, py_source_object);
}
%%
+override g_socket_listener_accept_async kwargs
+static PyObject *
+_wrap_g_socket_listener_accept_async(PyGObject *self,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *kwlist[] = { "callback", "cancellable", "user_data", NULL };
+ PyGIONotify *notify;
+ PyGObject *py_cancellable = NULL;
+ GCancellable *cancellable;
+
+ notify = pygio_notify_new();
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "O|OO:gio.SocketListener.accept_async",
+ kwlist,
+ &notify->callback,
+ &py_cancellable,
+ &notify->data))
+ goto error;
+
+ if (!pygio_notify_callback_is_valid(notify))
+ goto error;
+
+ if (!pygio_check_cancellable(py_cancellable, &cancellable))
+ goto error;
+
+ pygio_notify_reference_callback(notify);
+
+ g_socket_listener_accept_async(G_SOCKET_LISTENER(self->obj),
+ cancellable,
+ (GAsyncReadyCallback) async_result_callback_marshal,
+ notify);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+
+ error:
+ pygio_notify_free(notify);
+ return NULL;
+}
+%%
override g_socket_listener_accept_socket kwargs
static PyObject *
_wrap_g_socket_listener_accept_socket(PyGObject *self,