[Bf-blender-cvs] [dea4bcd] master: PyAPI: bpy.ops was showing 'module' in autocomplete output
Campbell Barton
noreply at git.blender.org
Wed Feb 19 04:24:56 CET 2014
Commit: dea4bcdf6791e7628d31a36bff097280012c988b
Author: Campbell Barton
Date: Wed Feb 19 13:41:41 2014 +1100
https://developer.blender.org/rBdea4bcdf6791e7628d31a36bff097280012c988b
PyAPI: bpy.ops was showing 'module' in autocomplete output
===================================================================
M release/scripts/modules/bpy/ops.py
===================================================================
diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py
index 52bf1c0..1d71bff 100644
--- a/release/scripts/modules/bpy/ops.py
+++ b/release/scripts/modules/bpy/ops.py
@@ -74,10 +74,10 @@ class BPyOpsSubMod(object):
eg. bpy.ops.object
"""
- __slots__ = ("module",)
+ __slots__ = ("_module",)
def __init__(self, module):
- self.module = module
+ self._module = module
def __getattr__(self, func):
"""
@@ -85,13 +85,13 @@ class BPyOpsSubMod(object):
"""
if func.startswith('__'):
raise AttributeError(func)
- return BPyOpsSubModOp(self.module, func)
+ return BPyOpsSubModOp(self._module, func)
def __dir__(self):
functions = set()
- module_upper = self.module.upper()
+ module_upper = self._module.upper()
for id_name in op_dir():
id_split = id_name.split('_OT_', 1)
@@ -101,7 +101,7 @@ class BPyOpsSubMod(object):
return list(functions)
def __repr__(self):
- return "<module like class 'bpy.ops.%s'>" % self.module
+ return "<module like class 'bpy.ops.%s'>" % self._module
class BPyOpsSubModOp(object):
@@ -111,7 +111,7 @@ class BPyOpsSubModOp(object):
eg. bpy.ops.object.somefunc
"""
- __slots__ = ("module", "func")
+ __slots__ = ("_module", "_func")
def _get_doc(self):
return op_as_string(self.idname())
@@ -156,8 +156,8 @@ class BPyOpsSubModOp(object):
__doc__ = property(_get_doc)
def __init__(self, module, func):
- self.module = module
- self.func = func
+ self._module = module
+ self._func = func
def poll(self, *args):
C_dict, C_exec, C_undo = BPyOpsSubModOp._parse_args(args)
@@ -165,11 +165,11 @@ class BPyOpsSubModOp(object):
def idname(self):
# submod.foo -> SUBMOD_OT_foo
- return self.module.upper() + "_OT_" + self.func
+ return self._module.upper() + "_OT_" + self._func
def idname_py(self):
# submod.foo -> SUBMOD_OT_foo
- return self.module + "." + self.func
+ return self._module + "." + self._func
def __call__(self, *args, **kw):
import bpy
@@ -217,6 +217,6 @@ class BPyOpsSubModOp(object):
def __str__(self): # used for print(...)
return ("<function bpy.ops.%s.%s at 0x%x'>" %
- (self.module, self.func, id(self)))
+ (self._module, self._func, id(self)))
ops_fake_module = BPyOps()
More information about the Bf-blender-cvs
mailing list