diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-03-29 15:47:09 +0000 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@src.gnome.org> | 2009-03-29 15:47:09 +0000 |
commit | 3869f3ca63ee3bcb2e3b643b2d7f2e9ff86a2d09 (patch) | |
tree | e4c3db8ba95de725a165cfc7c00217a1338589f7 /gio | |
parent | d7a8eb96ea6fe01e67d994ae853f49a8ca0e2e8d (diff) | |
download | pygobject-3869f3ca63ee3bcb2e3b643b2d7f2e9ff86a2d09.tar.gz pygobject-3869f3ca63ee3bcb2e3b643b2d7f2e9ff86a2d09.tar.xz pygobject-3869f3ca63ee3bcb2e3b643b2d7f2e9ff86a2d09.zip |
should accept None for mount_operation.
2009-03-29 Gian Mario Tagliaretti <gianmt@gnome.org>
* gio/gvolume.override: (_wrap_g_volume_mount) should accept None
for mount_operation.
svn path=/trunk/; revision=1040
Diffstat (limited to 'gio')
-rw-r--r-- | gio/gvolume.override | 25 |
1 files changed, 19 insertions, 6 deletions
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); |