[pygobject] docs: List default constructor in doc strings



commit 9ce527b09ed032f2cc83c2d83de8bb6d7b19be02
Author: Simon Feltman <sfeltman src gnome org>
Date:   Wed Jan 1 19:54:59 2014 -0800

    docs: List default constructor in doc strings
    
    Add default constructor to class docs strings as:
    Object(**properties)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708060

 gi/docstring.py |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gi/docstring.py b/gi/docstring.py
index 6141b5a..1a188ec 100644
--- a/gi/docstring.py
+++ b/gi/docstring.py
@@ -180,12 +180,10 @@ def _generate_callable_info_doc(info):
 
 
 def _generate_class_info_doc(info):
-    doc = ''
-    constructors = [method for method in info.get_methods() if method.is_constructor()]
-    if constructors:
-        doc += '\n:Constructors:\n'  # start with \n to avoid auto indent of other lines
-
-        for method_info in constructors:
+    doc = '\n:Constructors:\n'  # start with \n to avoid auto indent of other lines
+    doc += '    ' + info.get_name() + '(**properties)\n'
+    for method_info in info.get_methods():
+        if method_info.is_constructor():
             doc += '    ' + _generate_callable_info_doc(method_info) + '\n'
 
     return doc


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