pygobject r904 - in trunk: . gio tests
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: pygobject r904 - in trunk: . gio tests
- Date: Fri, 1 Aug 2008 16:35:48 +0000 (UTC)
Author: johan
Date: Fri Aug 1 16:35:48 2008
New Revision: 904
URL: http://svn.gnome.org/viewvc/pygobject?rev=904&view=rev
Log:
2008-08-01 Johan Dahlin <johan gnome org>
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
Modified:
trunk/ChangeLog
trunk/gio/gio.defs
trunk/gio/gio.override
trunk/tests/test_gio.py
Modified: trunk/gio/gio.defs
==============================================================================
--- trunk/gio/gio.defs (original)
+++ trunk/gio/gio.defs Fri Aug 1 16:35:48 2008
@@ -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
Modified: trunk/gio/gio.override
==============================================================================
--- trunk/gio/gio.override (original)
+++ trunk/gio/gio.override Fri Aug 1 16:35:48 2008
@@ -282,3 +282,24 @@
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;
+}
Modified: trunk/tests/test_gio.py
==============================================================================
--- trunk/tests/test_gio.py (original)
+++ trunk/tests/test_gio.py Fri Aug 1 16:35:48 2008
@@ -443,3 +443,11 @@
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, [])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]