summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-12-29 17:15:44 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2009-12-29 17:15:44 +0100
commit45b477342fa1c2435917c6d97745ad57665c4734 (patch)
treeb0d40c53db70ea73ab92efbe3dffec638aba4345
parent635227480f9659a1f91ab1ec12536d3ed012a976 (diff)
downloadpygobject-45b477342fa1c2435917c6d97745ad57665c4734.tar.gz
pygobject-45b477342fa1c2435917c6d97745ad57665c4734.tar.xz
pygobject-45b477342fa1c2435917c6d97745ad57665c4734.zip
Wrap gio.Drive.eject_with_data()
-rw-r--r--gio/gdrive.override54
1 files changed, 54 insertions, 0 deletions
diff --git a/gio/gdrive.override b/gio/gdrive.override
index 342cb1b..237b878 100644
--- a/gio/gdrive.override
+++ b/gio/gdrive.override
@@ -187,3 +187,57 @@ _wrap_g_drive_enumerate_identifiers (PyGObject *self)
}
return ret;
}
+%%
+override g_drive_eject_with_operation kwargs
+static PyObject *
+_wrap_g_drive_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;
+ GMountUnmountFlags flags = G_MOUNT_UNMOUNT_NONE;
+ PyGObject *py_cancellable = NULL;
+ GCancellable *cancellable;
+
+ notify = pygio_notify_new();
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "O|OOOO:gio.Drive.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_drive_eject_with_operation(G_DRIVE(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;
+}