[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31913] trunk/blender/release/scripts/ modules/bpy_types.py: fix for sphinx doc generation
Campbell Barton
ideasman42 at gmail.com
Mon Sep 13 15:29:54 CEST 2010
Revision: 31913
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31913
Author: campbellbarton
Date: 2010-09-13 15:29:54 +0200 (Mon, 13 Sep 2010)
Log Message:
-----------
fix for sphinx doc generation
Modified Paths:
--------------
trunk/blender/release/scripts/modules/bpy_types.py
Modified: trunk/blender/release/scripts/modules/bpy_types.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_types.py 2010-09-13 13:17:43 UTC (rev 31912)
+++ trunk/blender/release/scripts/modules/bpy_types.py 2010-09-13 13:29:54 UTC (rev 31913)
@@ -635,24 +635,28 @@
# Only defined so operators members can be used by accessing self.order
+# with doc generation 'self.properties.bl_rna.properties' can fail
class Operator(StructRNA, metaclass=OrderedMeta):
__slots__ = ()
def __getattribute__(self, attr):
properties = StructRNA.path_resolve(self, "properties")
- if attr in properties.bl_rna.properties:
+ bl_rna = getattr(properties, "bl_rna", None)
+ if bl_rna and attr in bl_rna.properties:
return getattr(properties, attr)
return super().__getattribute__(attr)
def __setattr__(self, attr, value):
properties = StructRNA.path_resolve(self, "properties")
- if attr in properties.bl_rna.properties:
+ bl_rna = getattr(properties, "bl_rna", None)
+ if bl_rna and attr in bl_rna.properties:
setattr(properties, attr, value)
return super().__setattr__(attr, value)
def __delattr__(self, attr):
properties = StructRNA.path_resolve(self, "properties")
- if attr in properties.bl_rna.properties:
+ bl_rna = getattr(properties, "bl_rna", None)
+ if bl_rna and attr in bl_rna.properties:
delattr(properties, attr)
return super().__delattr__(attr)
More information about the Bf-blender-cvs
mailing list