diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | gio/gio-types.defs | 7 | ||||
-rw-r--r-- | gio/gio.defs | 22 | ||||
-rw-r--r-- | tests/test_gio.py | 16 |
4 files changed, 37 insertions, 20 deletions
@@ -1,3 +1,15 @@ +2008-03-09 Johan Dahlin <johan@gnome.org> + + * gio/gio-types.defs: + * gio/gio.defs: + * tests/test_gio.py: + Update to SVN of gio: + g_file_contains_file -> g_file_has_prefix + can_seek and can_truncate are now only on the GSeekable interface + Add tests + + (#521207, Thomas Leonard) + 2008-03-08 Johan Dahlin <jdahlin@async.com.br> * gio/ginputstream.override: diff --git a/gio/gio-types.defs b/gio/gio-types.defs index 006d6fb..bb43ba3 100644 --- a/gio/gio-types.defs +++ b/gio/gio-types.defs @@ -80,6 +80,13 @@ (gtype-id "G_TYPE_FILE_ENUMERATOR") ) +(define-object FileInfo + (in-module "gio") + (parent "GObject") + (c-name "GFileInfo") + (gtype-id "G_TYPE_FILE_INFO") +) + (define-object FileMonitor (in-module "gio") (parent "GObject") diff --git a/gio/gio.defs b/gio/gio.defs index 9d7e5d1..0a28851 100644 --- a/gio/gio.defs +++ b/gio/gio.defs @@ -1190,9 +1190,9 @@ ) ) -(define-method contains_file +(define-method has_prefix (of-object "GFile") - (c-name "g_file_contains_file") + (c-name "g_file_has_prefix") (return-type "gboolean") (parameters '("GFile*" "descendant") @@ -2578,12 +2578,6 @@ (return-type "goffset") ) -(define-method can_seek - (of-object "GFileInputStream") - (c-name "g_file_input_stream_can_seek") - (return-type "gboolean") -) - (define-method seek (of-object "GFileInputStream") (c-name "g_file_input_stream_seek") @@ -2734,12 +2728,6 @@ (return-type "goffset") ) -(define-method can_seek - (of-object "GFileOutputStream") - (c-name "g_file_output_stream_can_seek") - (return-type "gboolean") -) - (define-method seek (of-object "GFileOutputStream") (c-name "g_file_output_stream_seek") @@ -2752,12 +2740,6 @@ ) ) -(define-method can_truncate - (of-object "GFileOutputStream") - (c-name "g_file_output_stream_can_truncate") - (return-type "gboolean") -) - (define-method truncate (of-object "GFileOutputStream") (c-name "g_file_output_stream_truncate") diff --git a/tests/test_gio.py b/tests/test_gio.py index b45e92f..2b12d5b 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -32,6 +32,22 @@ class TestFile(unittest.TestCase): loop = gobject.MainLoop() loop.run() +class TestGFileEnumerator(unittest.TestCase): + def setUp(self): + self.file = gio.file_new_for_path(".") + + def testEnumerateChildren(self): + found = [] + + e = self.file.enumerate_children("standard::*", gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) + while True: + info = e.next_file() + if not info: + break + found.append(info.get_name()) + e.close() + + assert 'test_gio.py' in found, found class TestInputStream(unittest.TestCase): def setUp(self): |