[Bf-blender-cvs] [1e882b86579] master: PyDoc: quiet output and minor cleanup

Campbell Barton noreply at git.blender.org
Mon May 23 04:38:42 CEST 2022


Commit: 1e882b86579b7aea76fd81ee121949e03c7599be
Author: Campbell Barton
Date:   Mon May 23 11:43:47 2022 +1000
Branches: master
https://developer.blender.org/rB1e882b86579b7aea76fd81ee121949e03c7599be

PyDoc: quiet output and minor cleanup

Suppress printing unnecessary output when generating docs.

===================================================================

M	doc/python_api/sphinx_doc_gen.py
M	release/scripts/modules/rna_info.py

===================================================================

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



More information about the Bf-blender-cvs mailing list