Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-01-18 13:45:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-18 13:45:54 +0300
commitfe67b9d6f2c8c3b4e3de61e013024639ffcba844 (patch)
treefed99c49731e0b5794f875aa078396ba913c2888 /source
parente723b060fc596876ec4778589a5d6c88027187db (diff)
reference docs: include type info with function return values
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/sphinx_doc_gen.py10
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"):