[pygobject] Wrap gio.SocketClient.connect_async()
- From: Gian Mario Tagliaretti <gianmt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pygobject] Wrap gio.SocketClient.connect_async()
- Date: Thu, 31 Dec 2009 09:21:59 +0000 (UTC)
commit 9c930910505d5b9001b8cec17ff98fadeaa799e2
Author: Gian Mario Tagliaretti <gianmt gnome org>
Date: Thu Dec 31 09:59:46 2009 +0100
Wrap gio.SocketClient.connect_async()
gio/gsocket.override | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/gio/gsocket.override b/gio/gsocket.override
index 95e6527..c44af34 100644
--- a/gio/gsocket.override
+++ b/gio/gsocket.override
@@ -108,6 +108,51 @@ _wrap_g_socket_address_enumerator_next_async(PyGObject *self,
pygio_notify_free(notify);
return NULL;
}
+%%
+override g_socket_client_connect_async kwargs
+static PyObject *
+_wrap_g_socket_client_connect_async(PyGObject *self,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *kwlist[] = { "callback", "connectable", "cancellable", "user_data", NULL };
+ PyGIONotify *notify;
+ PyGObject *py_cancellable = NULL;
+ GCancellable *cancellable;
+ PyGObject *py_connectable;
+
+ notify = pygio_notify_new();
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "OO|OO:gio.SocketClient.connect_async",
+ kwlist,
+ ¬ify->callback,
+ &py_connectable,
+ &py_cancellable,
+ ¬ify->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_client_connect_async(G_SOCKET_CLIENT(self->obj),
+ G_SOCKET_CONNECTABLE(py_connectable->obj),
+ cancellable,
+ (GAsyncReadyCallback) async_result_callback_marshal,
+ notify);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+
+ error:
+ pygio_notify_free(notify);
+ return NULL;
+}
/* Could not write method GSocket.receive_from: No ArgType for GSocketAddress** */
/* Could not write method GSocket.receive_message: No ArgType for GSocketAddress** */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]