summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2010-01-01 16:56:26 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2010-01-01 16:56:26 +0100
commit99902b786500948c3278779841e4db54223b9256 (patch)
tree384885ebf131d42817fbcc9cacff3d8ab8f8efee
parent8cff5d53183ae81364ac74a34a1d52e55e082eb4 (diff)
downloadpygobject-99902b786500948c3278779841e4db54223b9256.tar.gz
pygobject-99902b786500948c3278779841e4db54223b9256.tar.xz
pygobject-99902b786500948c3278779841e4db54223b9256.zip
Wrap gio.File.open_readwrite_async()
-rw-r--r--gio/gfile.override44
1 files changed, 44 insertions, 0 deletions
diff --git a/gio/gfile.override b/gio/gfile.override
index 27cbee7..26f92bb 100644
--- a/gio/gfile.override
+++ b/gio/gfile.override
@@ -1007,6 +1007,50 @@ _wrap_g_file_create_readwrite_async(PyGObject *self,
return NULL;
}
%%
+override g_file_open_readwrite_async kwargs
+static PyObject *
+_wrap_g_file_open_readwrite_async(PyGObject *self,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *kwlist[] = { "callback", "io_priority",
+ "cancellable", "user_data", NULL };
+ GCancellable *cancellable;
+ PyGObject *pycancellable = NULL;
+ int io_priority = G_PRIORITY_DEFAULT;
+ PyGIONotify *notify;
+
+ notify = pygio_notify_new();
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "O|iOO:File.open_readwrite_async",
+ kwlist,
+ &notify->callback,
+ &io_priority,
+ &pycancellable,
+ &notify->data))
+ goto error;
+
+ if (!pygio_notify_callback_is_valid(notify))
+ goto error;
+
+ if (!pygio_check_cancellable(pycancellable, &cancellable))
+ goto error;
+
+ pygio_notify_reference_callback(notify);
+
+ g_file_open_readwrite_async(G_FILE(self->obj), io_priority, cancellable,
+ (GAsyncReadyCallback)async_result_callback_marshal,
+ notify);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+
+ error:
+ pygio_notify_free(notify);
+ return NULL;
+}
+%%
override g_file_replace_async kwargs
static PyObject *
_wrap_g_file_replace_async(PyGObject *self, PyObject *args, PyObject *kwargs)