[pygobject] docs: Fix function doc string generator return types



commit 1f78dc0ace5282def9f1f700bfe4523de07e7549
Author: Simon Feltman <sfeltman src gnome org>
Date:   Fri Aug 29 16:49:14 2014 -0700

    docs: Fix function doc string generator return types
    
    Change skip_return() access into a function call. This was causing
    return type doc strings to always be skipped.

 gi/docstring.py         |    2 +-
 tests/test_docstring.py |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gi/docstring.py b/gi/docstring.py
index 80bb022..2cfd55a 100644
--- a/gi/docstring.py
+++ b/gi/docstring.py
@@ -148,7 +148,7 @@ def _generate_callable_info_doc(info):
     # Build return + output argument strings
     out_args_strs = []
     return_hint = _get_pytype_hint(info.get_return_type())
-    if not info.skip_return and return_hint and return_hint not in hint_blacklist:
+    if not info.skip_return() and return_hint and return_hint not in hint_blacklist:
         if info.may_return_null():
             argstr += ' or None'
         out_args_strs.append(return_hint)
diff --git a/tests/test_docstring.py b/tests/test_docstring.py
index 7573699..8e83724 100644
--- a/tests/test_docstring.py
+++ b/tests/test_docstring.py
@@ -45,7 +45,7 @@ class Test(unittest.TestCase):
                           'flags:Gio.FileCopyFlags, ' \
                           'cancellable:Gio.Cancellable=None, ' \
                           'progress_callback:Gio.FileProgressCallback=None, ' \
-                          'progress_callback_data=None)'
+                          'progress_callback_data=None) -> bool'
 
         self.assertEqual(Gio.File.copy.__doc__, g_file_copy_doc)
 
@@ -57,7 +57,11 @@ class Test(unittest.TestCase):
         # This tests implicit array length args along with skipping a
         # boolean return
         self.assertEqual(GIMarshallingTests.init_function.__doc__,
-                         'init_function(argv:list=None) -> argv:list')
+                         'init_function(argv:list=None) -> bool, argv:list')
+
+    def test_boolean_return(self):
+        self.assertEqual(GIMarshallingTests.boolean_return_true.__doc__,
+                         'boolean_return_true() -> bool')
 
     def test_class_doc_constructors(self):
         doc = GIMarshallingTests.Object.__doc__


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