summaryrefslogtreecommitdiffstats
path: root/gio
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2010-01-01 20:25:35 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2010-01-01 20:25:35 +0100
commitc1f34be73bd186d7b4682dfef133da2c4229d213 (patch)
tree9e86d54cc71ce4b0f1b1248f130f0a25430b6b1d /gio
parent9b76fbff6f6897aaf26ed4644c1f19efc2826917 (diff)
downloadpygobject-c1f34be73bd186d7b4682dfef133da2c4229d213.tar.gz
pygobject-c1f34be73bd186d7b4682dfef133da2c4229d213.tar.xz
pygobject-c1f34be73bd186d7b4682dfef133da2c4229d213.zip
Wrap gio.Volume.eject_with_operation()
Diffstat (limited to 'gio')
-rw-r--r--gio/gvolume.override54
1 files changed, 54 insertions, 0 deletions
diff --git a/gio/gvolume.override b/gio/gvolume.override
index 9afe19d..89c27e4 100644
--- a/gio/gvolume.override
+++ b/gio/gvolume.override
@@ -181,3 +181,57 @@ _wrap_g_volume_enumerate_identifiers (PyGObject *self)
}
return ret;
}
+%%
+override g_volume_eject_with_operation kwargs
+static PyObject *
+_wrap_g_volume_eject_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.Volume.eject_with_operation",
+ kwlist,
+ &notify->callback,
+ &py_flags,
+ &mount_operation,
+ &py_cancellable,
+ &notify->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_volume_eject_with_operation(G_VOLUME(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;
+}