diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-23 04:43:47 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-23 05:37:28 +0300 |
commit | 1e882b86579b7aea76fd81ee121949e03c7599be (patch) | |
tree | 94fb4a3491a97f75aeb50ed816652ae7e84eb002 | |
parent | 4d509fd6e14c475a2318ca37ba81ed04f7028ec1 (diff) |
PyDoc: quiet output and minor cleanup
Suppress printing unnecessary output when generating docs.
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 11 | ||||
-rw-r--r-- | release/scripts/modules/rna_info.py | 17 |
2 files changed, 22 insertions, 6 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index fe723d88c2a..be94a54b24c 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -13,10 +13,10 @@ API dump in RST files providing ./blender is or links to the blender executable To choose sphinx-in directory: - blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py -- --output ../python_api + blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py -- --output=../python_api For quick builds: - blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py -- --partial bmesh.* + blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py -- --partial=bmesh.* Sphinx: HTML generation @@ -98,8 +98,9 @@ def handle_args(): type=str, default="", help="Use a wildcard to only build specific module(s)\n" - "Example: --partial bmesh*\n", - required=False,) + "Example: --partial\"=bmesh*\"\n", + required=False, + ) parser.add_argument( "-f", "--fullrebuild", @@ -287,7 +288,7 @@ else: if FILTER_BPY_TYPES: EXCLUDE_MODULES.remove("bpy.types") - print(FILTER_BPY_TYPES) + # print(FILTER_BPY_TYPES) EXCLUDE_INFO_DOCS = (not fnmatch.fnmatchcase("info", ARGS.partial)) diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py index 76b59e4e816..04120508df5 100644 --- a/release/scripts/modules/rna_info.py +++ b/release/scripts/modules/rna_info.py @@ -585,6 +585,16 @@ def BuildRNAInfo(): structs = [] def _bpy_types_iterator(): + # Don't report when these types are ignored. + suppress_warning = { + "bpy_func", + "bpy_prop", + "bpy_prop_array", + "bpy_prop_collection", + "bpy_struct", + "bpy_struct_meta_idprop", + } + names_unique = set() rna_type_list = [] for rna_type_name in dir(bpy.types): @@ -594,8 +604,13 @@ def BuildRNAInfo(): if rna_struct is not None: rna_type_list.append(rna_type) yield (rna_type_name, rna_struct) + elif rna_type_name.startswith("_"): + # Ignore "__dir__", "__getattr__" .. etc. + pass + elif rna_type_name in suppress_warning: + pass else: - print("Ignoring", rna_type_name) + print("rna_info.BuildRNAInfo(..): ignoring type", repr(rna_type_name)) # Now, there are some sub-classes in add-ons we also want to include. # Cycles for e.g. these are referenced from the Scene, but not part of |