diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-18 13:45:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-18 13:45:54 +0300 |
commit | fe67b9d6f2c8c3b4e3de61e013024639ffcba844 (patch) | |
tree | fed99c49731e0b5794f875aa078396ba913c2888 /source | |
parent | e723b060fc596876ec4778589a5d6c88027187db (diff) |
reference docs: include type info with function return values
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/sphinx_doc_gen.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/python/sphinx_doc_gen.py b/source/blender/python/sphinx_doc_gen.py index 1b761a6d73d..ec17139b843 100644 --- a/source/blender/python/sphinx_doc_gen.py +++ b/source/blender/python/sphinx_doc_gen.py @@ -98,14 +98,18 @@ def rna2sphinx(BASEPATH): if is_return: id_name = "return" id_type = "rtype" + kwargs = {"as_ret": True, "class_fmt": ":class:`%s`"} + identifier = "" else: id_name = "arg" id_type = "type" + kwargs = {"as_arg": True, "class_fmt": ":class:`%s`"} + identifier = " %s" % prop.identifier - type_descr = prop.get_type_description(as_arg=True, class_fmt=":class:`%s`") + type_descr = prop.get_type_description(**kwargs) if prop.name or prop.description: - fw(ident + ":%s %s: %s\n" % (id_name, prop.identifier, ", ".join([val for val in (prop.name, prop.description) if val]))) - fw(ident + ":%s %s: %s\n" % (id_type, prop.identifier, type_descr)) + fw(ident + ":%s%s: %s\n" % (id_name, identifier, ", ".join([val for val in (prop.name, prop.description) if val]))) + fw(ident + ":%s%s: %s\n" % (id_type, identifier, type_descr)) def write_struct(struct): #if not struct.identifier.startswith("Sc") and not struct.identifier.startswith("I"): |