summaryrefslogtreecommitdiffstats
path: root/gio/gfileenumerator.override
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-03-22 00:12:35 +0000
committerGian Mario Tagliaretti <gianmt@src.gnome.org>2009-03-22 00:12:35 +0000
commit29b06919c7abdc6b896a07ef11829bdeba1a4935 (patch)
treea7b38490b0b2f7bf8a592855a35efc076b58e1c0 /gio/gfileenumerator.override
parent360f533eb6e244dae4cc748618bd77348f206f46 (diff)
downloadpygobject-29b06919c7abdc6b896a07ef11829bdeba1a4935.tar.gz
pygobject-29b06919c7abdc6b896a07ef11829bdeba1a4935.tar.xz
pygobject-29b06919c7abdc6b896a07ef11829bdeba1a4935.zip
gio/gfileenumerator.override (_wrap_g_file_enumerator_close_async) wrap
2009-03-22 Gian Mario Tagliaretti <gianmt@gnome.org> * gio/gfileenumerator.override (_wrap_g_file_enumerator_close_async) wrap new method. * tests/test_gio.py (TestGFileEnumerator.testCloseFilesAsync): Test the above. svn path=/trunk/; revision=1027
Diffstat (limited to 'gio/gfileenumerator.override')
-rw-r--r--gio/gfileenumerator.override46
1 files changed, 46 insertions, 0 deletions
diff --git a/gio/gfileenumerator.override b/gio/gfileenumerator.override
index 2044e44..876aca6 100644
--- a/gio/gfileenumerator.override
+++ b/gio/gfileenumerator.override
@@ -136,3 +136,49 @@ _wrap_g_file_enumerator_next_files_finish(PyGObject *self, PyObject *args, PyObj
return ret;
}
+%%
+override g_file_enumerator_close_async kwargs
+static PyObject *
+_wrap_g_file_enumerator_close_async(PyGObject *self,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *kwlist[] = { "callback", "io_priority", "cancellable",
+ "user_data", NULL };
+ int io_priority = G_PRIORITY_DEFAULT;
+ PyGObject *pycancellable = NULL;
+ GCancellable *cancellable;
+ PyGIONotify *notify;
+
+ notify = pygio_notify_new();
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "O|iOO:GFileEnumerator.close_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_enumerator_close_async(G_FILE_ENUMERATOR(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;
+}