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
diff options
context:
space:
mode:
authorSergej Reich <sergej.reich@googlemail.com>2013-11-23 20:17:12 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-11-23 20:17:12 +0400
commit39dc956f593b3406bf1d81fb83c557b7b51f5327 (patch)
tree50b59815aad48902a6563aefc8b944daf34c401e /doc/python_api/sphinx_doc_gen.py
parent5d5176095e82b34499e15d74f1fb76d56f4d9508 (diff)
parentd846c9a3b75c3d6f20bc7ab7d2da6cdd18bbbef2 (diff)
Merge branch 'master' into soc-2013-rigid_body_simsoc-2013-rigid_body_sim
Conflicts: intern/rigidbody/CMakeLists.txt release/datafiles/splash.png source/blender/editors/space_view3d/drawobject.c source/blender/makesdna/DNA_view3d_types.h
Diffstat (limited to 'doc/python_api/sphinx_doc_gen.py')
-rw-r--r--doc/python_api/sphinx_doc_gen.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index e661bb01e60..e95fa6fef35 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -466,7 +466,9 @@ ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
MethodDescriptorType = type(dict.get)
GetSetDescriptorType = type(int.real)
StaticMethodType = type(staticmethod(lambda: None))
-from types import MemberDescriptorType
+from types import (MemberDescriptorType,
+ MethodType,
+ )
_BPY_STRUCT_FAKE = "bpy_struct"
_BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection"
@@ -629,12 +631,12 @@ def pymethod2sphinx(ident, fw, identifier, py_func):
fw("\n")
-def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True):
+def pyfunc2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_class=True):
'''
function or class method to sphinx
'''
- if type(py_func) == type(bpy.types.Space.draw_handler_add):
+ if type(py_func) == MethodType:
return
arg_str = inspect.formatargspec(*inspect.getargspec(py_func))
@@ -657,6 +659,11 @@ def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True):
write_indented_lines(ident + " ", fw, py_func.__doc__)
fw("\n")
+ if is_class:
+ write_example_ref(ident + " ", fw, module_name + "." + type_name + "." + identifier)
+ else:
+ write_example_ref(ident + " ", fw, module_name + "." + identifier)
+
def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
if identifier.startswith("_"):
@@ -867,7 +874,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
for attribute, value, value_type in module_dir_value_type:
if value_type == types.FunctionType:
- pyfunc2sphinx("", fw, attribute, value, is_class=False)
+ pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType): # both the same at the moment but to be future proof
# note: can't get args from these, so dump the string as is
# this means any module used like this must have fully formatted docstrings.
@@ -1316,7 +1323,7 @@ def pyrna2sphinx(basepath):
py_func = None
for identifier, py_func in py_funcs:
- pyfunc2sphinx(" ", fw, identifier, py_func, is_class=True)
+ pyfunc2sphinx(" ", fw, "bpy.types", struct_id, identifier, py_func, is_class=True)
del py_funcs, py_func
py_funcs = struct.get_py_c_functions()