pygobject r750 - in trunk: . gio tests



Author: johan
Date: Sun Mar  9 23:07:59 2008
New Revision: 750
URL: http://svn.gnome.org/viewvc/pygobject?rev=750&view=rev

Log:
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)



Modified:
   trunk/ChangeLog
   trunk/gio/gio-types.defs
   trunk/gio/gio.defs
   trunk/tests/test_gio.py

Modified: trunk/gio/gio-types.defs
==============================================================================
--- trunk/gio/gio-types.defs	(original)
+++ trunk/gio/gio-types.defs	Sun Mar  9 23:07:59 2008
@@ -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")

Modified: trunk/gio/gio.defs
==============================================================================
--- trunk/gio/gio.defs	(original)
+++ trunk/gio/gio.defs	Sun Mar  9 23:07:59 2008
@@ -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")

Modified: trunk/tests/test_gio.py
==============================================================================
--- trunk/tests/test_gio.py	(original)
+++ trunk/tests/test_gio.py	Sun Mar  9 23:07:59 2008
@@ -32,6 +32,22 @@
         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):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]