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/doc
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-05-12 11:06:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-05-12 11:24:32 +0300
commit34c78a659b7f157fa369c636b255326f04392ee0 (patch)
tree017316dfb6d7d12b658c012fa1165adcd26de82e /doc
parentf727df6076241756a07aebdd495284203702dd1b (diff)
Doc: add bpy.utils.previews
Updated sphinx_doc_gen.py to better handle pure py-classes.
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/sphinx_doc_gen.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index a49378f2f0e..72ddf251946 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -257,6 +257,7 @@ else:
"bpy.props",
"bpy.types", # supports filtering
"bpy.utils",
+ "bpy.utils.previews",
"bpy_extras",
"gpu",
"mathutils",
@@ -642,10 +643,17 @@ def pyfunc2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_cla
else:
func_type = "staticmethod"
- fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
- if py_func.__doc__:
- write_indented_lines(ident + " ", fw, py_func.__doc__)
+ doc = py_func.__doc__
+ if (not doc) or (not doc.startswith(".. %s:: " % func_type)):
+ fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
+ ident_temp = ident + " "
+ else:
+ ident_temp = ident
+
+ if doc:
+ write_indented_lines(ident_temp, fw, doc)
fw("\n")
+ del doc, ident_temp
if is_class:
write_example_ref(ident + " ", fw, module_name + "." + type_name + "." + identifier)
@@ -916,7 +924,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
fw(value.__doc__)
else:
fw(".. class:: %s\n\n" % type_name)
- write_indented_lines(" ", fw, value.__doc__, False)
+ write_indented_lines(" ", fw, value.__doc__, True)
else:
fw(".. class:: %s\n\n" % type_name)
fw("\n")
@@ -929,6 +937,11 @@ def pymodule2sphinx(basepath, module_name, module, title):
if type(descr) == ClassMethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
+ # needed for pure python classes
+ for key, descr in descr_items:
+ if type(descr) == types.FunctionType:
+ pyfunc2sphinx(" ", fw, module_name, type_name, key, descr, is_class=True)
+
for key, descr in descr_items:
if type(descr) == MethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
@@ -1608,6 +1621,7 @@ def write_rst_contents(basepath):
# py modules
"bpy.utils",
+ "bpy.utils.previews",
"bpy.path",
"bpy.app",
"bpy.app.handlers",