diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-12-29 09:54:05 +0100 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-12-29 13:27:40 +0100 |
commit | 0fe00109c4f6fc27cbaae9b0a24ecfac71355d2f (patch) | |
tree | 26880eed26c2312867fb39078b6cc10f0887b909 /gio | |
parent | 86783c695f3641b9491962e8f95a4dcb91f4017c (diff) | |
download | pygobject-0fe00109c4f6fc27cbaae9b0a24ecfac71355d2f.tar.gz pygobject-0fe00109c4f6fc27cbaae9b0a24ecfac71355d2f.tar.xz pygobject-0fe00109c4f6fc27cbaae9b0a24ecfac71355d2f.zip |
Wrap gio.FileIOStream.query_info_async() and add a test
Diffstat (limited to 'gio')
-rw-r--r-- | gio/Makefile.am | 1 | ||||
-rw-r--r-- | gio/gfileiostream.override | 68 | ||||
-rw-r--r-- | gio/gio.override | 1 |
3 files changed, 70 insertions, 0 deletions
diff --git a/gio/Makefile.am b/gio/Makefile.am index ae2c2b3..1c5b41f 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -46,6 +46,7 @@ GIO_OVERRIDES = \ gfileenumerator.override \ gfileinfo.override \ gfileinputstream.override \ + gfileiostream.override \ gfileoutputstream.override \ gicon.override \ giostream.override \ diff --git a/gio/gfileiostream.override b/gio/gfileiostream.override new file mode 100644 index 0000000..7be6124 --- /dev/null +++ b/gio/gfileiostream.override @@ -0,0 +1,68 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * pygobject - Python bindings for GObject + * Copyright (C) 2009 Gian Mario Tagliaretti + * + * gfileiostream.override: module overrides for GFileIOStream + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +%% +override g_file_io_stream_query_info_async kwargs +static PyObject * +_wrap_g_file_io_stream_query_info_async(PyGObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "attributes", "callback", + "io_priority", "cancellable", "user_data", NULL }; + GCancellable *cancellable; + PyGObject *pycancellable = NULL; + int io_priority = G_PRIORITY_DEFAULT; + char *attributes; + PyGIONotify *notify; + + notify = pygio_notify_new(); + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, + "sO|iOO:gio.FileIOStream.query_info_async", + kwlist, + &attributes, + ¬ify->callback, + &io_priority, + &pycancellable, + ¬ify->data)) + + if (!pygio_notify_callback_is_valid(notify)) + goto error; + + if (!pygio_check_cancellable(pycancellable, &cancellable)) + goto error; + + pygio_notify_reference_callback(notify); + + g_file_io_stream_query_info_async(G_FILE_IO_STREAM(self->obj), + attributes, io_priority, cancellable, + (GAsyncReadyCallback)async_result_callback_marshal, + notify); + + Py_INCREF(Py_None); + return Py_None; + + error: + pygio_notify_free(notify); + return NULL; +} diff --git a/gio/gio.override b/gio/gio.override index 172395b..c9b13c3 100644 --- a/gio/gio.override +++ b/gio/gio.override @@ -238,6 +238,7 @@ include gfileenumerator.override gfileinfo.override gfileinputstream.override + gfileiostream.override gfileoutputstream.override gicon.override giostream.override |