diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2010-01-01 13:00:42 +0100 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@gnome.org> | 2010-01-01 13:00:42 +0100 |
commit | 29043bade408338cefa13fb4b0c875aabd3ef05e (patch) | |
tree | 83f5554a28173294dab8bdbcb77a36f95ea7339d /gio | |
parent | dff374287bbecc8af782bbc726fad86c6c867754 (diff) | |
download | pygobject-29043bade408338cefa13fb4b0c875aabd3ef05e.tar.gz pygobject-29043bade408338cefa13fb4b0c875aabd3ef05e.tar.xz pygobject-29043bade408338cefa13fb4b0c875aabd3ef05e.zip |
Wrap gio.Drive.start()
Diffstat (limited to 'gio')
-rw-r--r-- | gio/gdrive.override | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gio/gdrive.override b/gio/gdrive.override index 237b878..85c8ea7 100644 --- a/gio/gdrive.override +++ b/gio/gdrive.override @@ -241,3 +241,55 @@ _wrap_g_drive_eject_with_operation(PyGObject *self, pygio_notify_free(notify); return NULL; } +%% +override g_drive_start kwargs +static PyObject * +_wrap_g_drive_start(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; + GDriveStartFlags flags = G_DRIVE_START_NONE; + PyGObject *py_cancellable = NULL; + GCancellable *cancellable; + + notify = pygio_notify_new(); + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, + "O|OOOO:gio.Drive.start", + 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_DRIVE_START_FLAGS, + py_flags, (gpointer) &flags)) + goto error; + + if (!pygio_check_cancellable(py_cancellable, &cancellable)) + goto error; + + pygio_notify_reference_callback(notify); + + g_drive_start(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; +} |