summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-01-01 19:54:59 -0800
committerSimon Feltman <sfeltman@src.gnome.org>2014-01-01 19:54:59 -0800
commit9ce527b09ed032f2cc83c2d83de8bb6d7b19be02 (patch)
tree19c7009ebf128a534a51891959d2e2a9a1d5a95b
parent9bfd73e7c3f2ec4975b3e530ba7c2cc55ee793d5 (diff)
downloadpygobject-9ce527b09ed032f2cc83c2d83de8bb6d7b19be02.tar.gz
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
-rw-r--r--gi/docstring.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/gi/docstring.py b/gi/docstring.py
index 6141b5ac..1a188ecd 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