From 60d03ac1b8f211e805ea129b54d2a60b40627255 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Fri, 1 Aug 2008 16:35:48 +0000 Subject: Bug 545846 – g_vfs_get_supported_uri_schemes is missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-08-01 Johan Dahlin Bug 545846 – g_vfs_get_supported_uri_schemes is missing * gio/gio.defs: * gio/gio.override: * tests/test_gio.py: Wrap, add test and documentation svn path=/trunk/; revision=904 --- ChangeLog | 9 +++++++++ gio/gio.defs | 9 +++++++++ gio/gio.override | 21 +++++++++++++++++++++ tests/test_gio.py | 8 ++++++++ 4 files changed, 47 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9c5dedc..6940203 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-01 Johan Dahlin + + Bug 545846 – g_vfs_get_supported_uri_schemes is missing + + * gio/gio.defs: + * gio/gio.override: + * tests/test_gio.py: + Wrap, add test and documentation + 2008-08-01 Johan Dahlin * glib/glibmodule.c (pyglib_set_application_name): diff --git a/gio/gio.defs b/gio/gio.defs index 791caff..be3087d 100644 --- a/gio/gio.defs +++ b/gio/gio.defs @@ -4320,6 +4320,15 @@ (return-type "GVfs*") ) +(define-method get_supported_uri_schemes + (docstring +"VFS.get_supported_uri_schemes() -> [uri, ..]\n" +"Gets a list of URI schemes supported by vfs.") + (of-object "GVfs") + (c-name "g_vfs_get_supported_uri_schemes") + (return-type "const-char*-const*") +) + ;; From gwin32appinfo.h diff --git a/gio/gio.override b/gio/gio.override index 9146ba3..46fc6a6 100644 --- a/gio/gio.override +++ b/gio/gio.override @@ -282,3 +282,24 @@ _wrap_g_mount_unmount(PyGObject *self, Py_INCREF(Py_None); return Py_None; } +%% +override g_vfs_get_supported_uri_schemes noargs +static PyObject * +_wrap_g_vfs_get_supported_uri_schemes(PyGObject *self) +{ + const char * const *names; + PyObject *ret; + + names = g_vfs_get_supported_uri_schemes(G_VFS(self->obj)); + + ret = PyList_New(0); + while (names && *names) { + PyObject *item = PyString_FromString(names[0]); + PyList_Append(ret, item); + Py_DECREF(item); + + names++; + } + + return ret; +} diff --git a/tests/test_gio.py b/tests/test_gio.py index 4acb387..39f7796 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -443,3 +443,11 @@ class TestAppInfo(unittest.TestCase): def testSimple(self): self.assertEquals(self.appinfo.get_description(), "Custom definition for does-not-exist") + +class TestVfs(unittest.TestCase): + def setUp(self): + self.vfs = gio.vfs_get_default() + + def testGetSupportedURISchemes(self): + result = self.vfs.get_supported_uri_schemes() + self.failUnless(isinstance(result, []) -- cgit