diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2010-01-01 20:15:38 +0100 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@gnome.org> | 2010-01-01 20:15:38 +0100 |
commit | d4b5d1b4839364e5676eb2da28f1d21db7e2552d (patch) | |
tree | 338c39f60d8f04aaaa29facd63ff119dd7e12515 | |
parent | e919d47c2430451b436cec955e9b99237f97028c (diff) | |
download | pygobject-d4b5d1b4839364e5676eb2da28f1d21db7e2552d.tar.gz pygobject-d4b5d1b4839364e5676eb2da28f1d21db7e2552d.tar.xz pygobject-d4b5d1b4839364e5676eb2da28f1d21db7e2552d.zip |
Wrap gio.Mount.unmount_mountable_with_operation()
-rw-r--r-- | gio/gmount.override | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/gio/gmount.override b/gio/gmount.override index ba88a19..1d75c96 100644 --- a/gio/gmount.override +++ b/gio/gmount.override @@ -344,3 +344,57 @@ _wrap_g_mount_tp_repr(PyGObject *self) g_free(representation); return result; } +%% +override g_mount_unmount_with_operation kwargs +static PyObject * +_wrap_g_mount_unmount_with_operation(PyGObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "callback", "flags", "mount_operation", + "cancellable", "user_data", NULL }; + PyGIONotify *notify; + PyObject *py_flags = NULL; + PyGObject *mount_operation; + PyGObject *py_cancellable = NULL; + GMountUnmountFlags flags = G_MOUNT_UNMOUNT_NONE; + GCancellable *cancellable; + + notify = pygio_notify_new(); + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, + "O|OOOO:gio.Mount.unmount_mountable_with_operation", + kwlist, + ¬ify->callback, + &py_flags, + &mount_operation, + &py_cancellable, + ¬ify->data)) + goto error; + + if (!pygio_notify_callback_is_valid(notify)) + goto error; + + if (py_flags && pyg_flags_get_value(G_TYPE_MOUNT_UNMOUNT_FLAGS, + py_flags, (gpointer)&flags)) + goto error; + + if (!pygio_check_cancellable(py_cancellable, &cancellable)) + goto error; + + pygio_notify_reference_callback(notify); + + g_file_unmount_mountable_with_operation(G_FILE(self->obj), + flags, + G_MOUNT_OPERATION(mount_operation->obj), + cancellable, + (GAsyncReadyCallback)async_result_callback_marshal, + notify); + + Py_INCREF(Py_None); + return Py_None; + + error: + pygio_notify_free(notify); + return NULL; +} |