formatting edits in py api, no functional changes

This commit is contained in:
2011-12-18 08:50:06 +00:00
parent 414370b8d4
commit 9c9099a805
17 changed files with 132 additions and 128 deletions

View File

@@ -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);