From c2b2ccde45a9424339337ef130255138b912d29d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 10 Feb 2010 11:10:38 +0000 Subject: fix for python not being able to call operators with a executuon context. --- release/scripts/modules/bpy/ops.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'release') diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py index efa4a51530b..0975bf1c60b 100644 --- a/release/scripts/modules/bpy/ops.py +++ b/release/scripts/modules/bpy/ops.py @@ -27,19 +27,6 @@ op_call = ops_module.call op_as_string = ops_module.as_string op_get_rna = ops_module.get_rna -# Keep in sync with WM_types.h -context_dict = { - 'INVOKE_DEFAULT': 0, - 'INVOKE_REGION_WIN': 1, - 'INVOKE_AREA': 2, - 'INVOKE_SCREEN': 3, - 'EXEC_DEFAULT': 4, - 'EXEC_REGION_WIN': 5, - 'EXEC_AREA': 6, - 'EXEC_SCREEN': 7, -} - - class bpy_ops(object): ''' Fake module like class. @@ -161,16 +148,10 @@ class bpy_ops_submodule_op(object): else: C_exec = args[0] - try: - context = context_dict[C_exec] - except: - raise ValueError("Expected a single context argument in: " + \ - str(list(context_dict.keys()))) - if len(args) == 2: C_dict = args[1] - ret = op_call(self.idname_py(), C_dict, kw, context) + ret = op_call(self.idname_py(), C_dict, kw, C_exec) else: ret = op_call(self.idname_py(), C_dict, kw) -- cgit v1.2.3