diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gio/gvolume.override | 25 |
2 files changed, 24 insertions, 6 deletions
@@ -1,5 +1,10 @@ 2009-03-29 Gian Mario Tagliaretti <gianmt@gnome.org> + * gio/gvolume.override: (_wrap_g_volume_mount) should accept None + for mount_operation. + +2009-03-29 Gian Mario Tagliaretti <gianmt@gnome.org> + * gio/gvolume.override: Swap kwargs names to reflect the code. 2009-03-29 Tobias Mueller <tobiasmue@gnome.org> diff --git a/gio/gvolume.override b/gio/gvolume.override index 310a849..9afe19d 100644 --- a/gio/gvolume.override +++ b/gio/gvolume.override @@ -30,7 +30,8 @@ _wrap_g_volume_mount(PyGObject *self, "cancellable", "user_data", NULL }; PyGIONotify *notify; PyObject *py_flags = NULL; - PyGObject *mount_operation; + PyGObject *py_mount_operation = NULL; + GMountOperation *mount_operation = NULL; PyGObject *py_cancellable = NULL; GMountMountFlags flags = G_MOUNT_MOUNT_NONE; GCancellable *cancellable; @@ -38,16 +39,28 @@ _wrap_g_volume_mount(PyGObject *self, notify = pygio_notify_new(); if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O!O|OOO:Volume.mount", + "OO|OOO:Volume.mount", kwlist, - &PyGMountOperation_Type, - &mount_operation, + &py_mount_operation, ¬ify->callback, &py_flags, &py_cancellable, ¬ify->data)) goto error; - + + if ((PyObject *)py_mount_operation == Py_None) + mount_operation = NULL; + + else if (py_mount_operation && pygobject_check(py_mount_operation, + &PyGMountOperation_Type)) + mount_operation = G_MOUNT_OPERATION(py_mount_operation->obj); + + else if (py_mount_operation) { + PyErr_SetString(PyExc_TypeError, + "mount_operation should be a GMountOperation or None"); + return NULL; + } + if (!pygio_notify_callback_is_valid(notify)) goto error; @@ -62,7 +75,7 @@ _wrap_g_volume_mount(PyGObject *self, g_volume_mount(G_VOLUME(self->obj), flags, - G_MOUNT_OPERATION(mount_operation->obj), + mount_operation, cancellable, (GAsyncReadyCallback)async_result_callback_marshal, notify); |