[Bf-blender-cvs] [775f0d76d55] master: Fix missing C/Python methods in API docs

Campbell Barton noreply at git.blender.org
Tue Apr 19 05:09:42 CEST 2022


Commit: 775f0d76d55b2977c30dcd0f9306437ae520d63f
Author: Campbell Barton
Date:   Tue Apr 19 13:04:35 2022 +1000
Branches: master
https://developer.blender.org/rB775f0d76d55b2977c30dcd0f9306437ae520d63f

Fix missing C/Python methods in API docs

The following methods weren't included in API docs.

- BlendDataLibraries.load
- BlendDataLibraries.write
- Text.region_as_string
- Text.region_from_string

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

M	release/scripts/modules/rna_info.py

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

diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py
index a8814759840..b009cc4fefe 100644
--- a/release/scripts/modules/rna_info.py
+++ b/release/scripts/modules/rna_info.py
@@ -198,7 +198,11 @@ class InfoStructRNA:
         for identifier, attr in self._get_py_visible_attrs():
             # methods may be python wrappers to C functions
             attr_func = getattr(attr, "__func__", attr)
-            if type(attr_func) in {types.BuiltinMethodType, types.BuiltinFunctionType}:
+            if (
+                    (type(attr_func) in {types.BuiltinMethodType, types.BuiltinFunctionType}) or
+                    # Without the `objclass` check, many inherited methods are included.
+                    (type(attr_func) == types.MethodDescriptorType and attr_func.__objclass__ == self.py_class)
+            ):
                 functions.append((identifier, attr))
         return functions



More information about the Bf-blender-cvs mailing list