diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-18 12:50:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-18 12:50:06 +0400 |
commit | 9c9099a805a1f143ae9916b2b6f03cbfe640bfff (patch) | |
tree | fad0cb1bbe1492b3157913486c264454c16ce9f9 /source/blender/python/intern/bpy_rna_callback.c | |
parent | 414370b8d42324878485e569fc332b814131887f (diff) |
formatting edits in py api, no functional changes
Diffstat (limited to 'source/blender/python/intern/bpy_rna_callback.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna_callback.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index 85f950947a7..134cbfda71f 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -60,7 +60,7 @@ static void cb_region_draw(const bContext *C, ARegion *UNUSED(ar), void *customd cb_args= PyTuple_GET_ITEM((PyObject *)customdata, 1); result= PyObject_CallObject(cb_func, cb_args); - if(result) { + if (result) { Py_DECREF(result); } else { @@ -82,21 +82,22 @@ PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args) if (!PyArg_ParseTuple(args, "OO!|s:bpy_struct.callback_add", &cb_func, &PyTuple_Type, &cb_args, &cb_event_str)) return NULL; - if(!PyCallable_Check(cb_func)) { + if (!PyCallable_Check(cb_func)) { PyErr_SetString(PyExc_TypeError, "callback_add(): first argument isn't callable"); return NULL; } - if(RNA_struct_is_a(self->ptr.type, &RNA_Region)) { - if(cb_event_str) { + if (RNA_struct_is_a(self->ptr.type, &RNA_Region)) { + if (cb_event_str) { static EnumPropertyItem region_draw_mode_items[]= { {REGION_DRAW_POST_PIXEL, "POST_PIXEL", 0, "Post Pixel", ""}, {REGION_DRAW_POST_VIEW, "POST_VIEW", 0, "Post View", ""}, {REGION_DRAW_PRE_VIEW, "PRE_VIEW", 0, "Pre View", ""}, {0, NULL, 0, NULL, NULL}}; - if(pyrna_enum_value_from_id(region_draw_mode_items, cb_event_str, &cb_event, "bpy_struct.callback_add()") < 0) + if (pyrna_enum_value_from_id(region_draw_mode_items, cb_event_str, &cb_event, "bpy_struct.callback_add()") < 0) { return NULL; + } } else { cb_event= REGION_DRAW_POST_PIXEL; @@ -124,12 +125,12 @@ PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args) handle= PyCapsule_GetPointer(py_handle, RNA_CAPSULE_ID); - if(handle==NULL) { + if (handle==NULL) { PyErr_SetString(PyExc_ValueError, "callback_remove(handle): NULL handle given, invalid or already removed"); return NULL; } - if(RNA_struct_is_a(self->ptr.type, &RNA_Region)) { + if (RNA_struct_is_a(self->ptr.type, &RNA_Region)) { customdata= ED_region_draw_cb_customdata(handle); Py_DECREF((PyObject *)customdata); |