diff options
Diffstat (limited to 'source/blender/python/intern/bpy_operator.c')
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index ebe6e05ee43..c230e952ca1 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -79,14 +79,19 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args) ot= WM_operatortype_find(opname, TRUE); if (ot == NULL) { - PyErr_Format(PyExc_AttributeError, "Polling operator \"bpy.ops.%s\" error, could not be found", opname); + PyErr_Format(PyExc_AttributeError, + "Polling operator \"bpy.ops.%s\" error, " + "could not be found", opname); return NULL; } if(context_str) { if(RNA_enum_value_from_id(operator_context_items, context_str, &context)==0) { char *enum_str= BPy_enum_as_string(operator_context_items); - PyErr_Format(PyExc_TypeError, "Calling operator \"bpy.ops.%s.poll\" error, expected a string enum in (%.200s)", opname, enum_str); + PyErr_Format(PyExc_TypeError, + "Calling operator \"bpy.ops.%s.poll\" error, " + "expected a string enum in (%.200s)", + opname, enum_str); MEM_freeN(enum_str); return NULL; } @@ -96,7 +101,10 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args) context_dict= NULL; } else if (!PyDict_Check(context_dict)) { - PyErr_Format(PyExc_TypeError, "Calling operator \"bpy.ops.%s.poll\" error, custom context expected a dict or None, got a %.200s", opname, Py_TYPE(context_dict)->tp_name); + PyErr_Format(PyExc_TypeError, + "Calling operator \"bpy.ops.%s.poll\" error, " + "custom context expected a dict or None, got a %.200s", + opname, Py_TYPE(context_dict)->tp_name); return NULL; } @@ -146,19 +154,27 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) ot= WM_operatortype_find(opname, TRUE); if (ot == NULL) { - PyErr_Format(PyExc_AttributeError, "Calling operator \"bpy.ops.%s\" error, could not be found", opname); + PyErr_Format(PyExc_AttributeError, + "Calling operator \"bpy.ops.%s\" error, " + "could not be found", opname); return NULL; } if(!pyrna_write_check()) { - PyErr_Format(PyExc_RuntimeError, "Calling operator \"bpy.ops.%s\" error, can't modify blend data in this state (drawing/rendering)", opname); + PyErr_Format(PyExc_RuntimeError, + "Calling operator \"bpy.ops.%s\" error, " + "can't modify blend data in this state (drawing/rendering)", + opname); return NULL; } if(context_str) { if(RNA_enum_value_from_id(operator_context_items, context_str, &context)==0) { char *enum_str= BPy_enum_as_string(operator_context_items); - PyErr_Format(PyExc_TypeError, "Calling operator \"bpy.ops.%s\" error, expected a string enum in (%.200s)", opname, enum_str); + PyErr_Format(PyExc_TypeError, + "Calling operator \"bpy.ops.%s\" error, " + "expected a string enum in (%.200s)", + opname, enum_str); MEM_freeN(enum_str); return NULL; } @@ -168,7 +184,10 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) context_dict= NULL; } else if (!PyDict_Check(context_dict)) { - PyErr_Format(PyExc_TypeError, "Calling operator \"bpy.ops.%s\" error, custom context expected a dict or None, got a %.200s", opname, Py_TYPE(context_dict)->tp_name); + PyErr_Format(PyExc_TypeError, + "Calling operator \"bpy.ops.%s\" error, " + "custom context expected a dict or None, got a %.200s", + opname, Py_TYPE(context_dict)->tp_name); return NULL; } @@ -179,7 +198,9 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) if(WM_operator_poll_context((bContext*)C, ot, context) == FALSE) { const char *msg= CTX_wm_operator_poll_msg_get(C); - PyErr_Format(PyExc_RuntimeError, "Operator bpy.ops.%.200s.poll() %.200s", opname, msg ? msg : "failed, context is incorrect"); + PyErr_Format(PyExc_RuntimeError, + "Operator bpy.ops.%.200s.poll() %.200s", + opname, msg ? msg : "failed, context is incorrect"); CTX_wm_operator_poll_msg_set(C, NULL); /* better set to NULL else it could be used again */ error_val= -1; } @@ -225,7 +246,9 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) { /* no props */ if (kw != NULL) { - PyErr_Format(PyExc_AttributeError, "Operator \"%s\" does not take any args", opname); + PyErr_Format(PyExc_AttributeError, + "Operator \"%s\" does not take any args", + opname); return NULL; } @@ -281,7 +304,9 @@ static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args) ot= WM_operatortype_find(opname, TRUE); if (ot == NULL) { - PyErr_Format(PyExc_AttributeError, "_bpy.ops.as_string: operator \"%.200s\"could not be found", opname); + PyErr_Format(PyExc_AttributeError, + "_bpy.ops.as_string: operator \"%.200s\" " + "could not be found", opname); return NULL; } |