diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-11-15 18:37:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-15 18:41:17 +0300 |
commit | 0384cc6f7805ec6b7c4b36c12911c6f1448073bf (patch) | |
tree | 022421cdeb219dd3880fe84cf2e88b42e22f9103 /doc | |
parent | 4ca87085e0d0e7d831b29e407d723ef8d2165a37 (diff) |
API Docs: don't show functions in 'bpy.app.handlers'
This shows the function and it's memory location,
it's not useful for docs so remove it.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 87bdb062d45..c334ffd798f 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -2066,7 +2066,7 @@ def refactor_sphinx_log(sphinx_logfile): refactored_logfile.write("%-12s %s\n %s\n" % log) -def monkey_patch(): +def setup_monkey_patch(): filepath = os.path.join(SCRIPT_DIR, "sphinx_doc_gen_monkeypatch.py") global_namespace = {"__file__": filepath, "__name__": "__main__"} file = open(filepath, 'rb') @@ -2074,10 +2074,24 @@ def monkey_patch(): file.close() +# Avoid adding too many changes here. +def setup_blender(): + import bpy + + # Remove handlers since the functions get included + # in the doc-string and don't have meaningful names. + for ls in bpy.app.handlers: + if isinstance(ls, list): + ls.clear() + + def main(): - # first monkey patch to load in fake members - monkey_patch() + # First monkey patch to load in fake members. + setup_monkey_patch() + + # Perform changes to Blender it's self. + setup_blender() # eventually, create the dirs for dir_path in [ARGS.output_dir, SPHINX_IN]: |