[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45190] trunk/blender/source/blender/ python: style cleanup: py api

Campbell Barton ideasman42 at gmail.com
Mon Mar 26 22:42:07 CEST 2012


Revision: 45190
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45190
Author:   campbellbarton
Date:     2012-03-26 20:41:54 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
style cleanup: py api

Modified Paths:
--------------
    trunk/blender/source/blender/python/bmesh/bmesh_py_types.c
    trunk/blender/source/blender/python/bmesh/bmesh_py_types_customdata.c
    trunk/blender/source/blender/python/intern/bpy.c
    trunk/blender/source/blender/python/intern/bpy_app.c
    trunk/blender/source/blender/python/intern/bpy_app_ffmpeg.c
    trunk/blender/source/blender/python/intern/bpy_app_handlers.c
    trunk/blender/source/blender/python/intern/bpy_interface.c
    trunk/blender/source/blender/python/intern/bpy_library.c
    trunk/blender/source/blender/python/intern/bpy_operator.c
    trunk/blender/source/blender/python/intern/bpy_operator_wrap.c
    trunk/blender/source/blender/python/intern/bpy_props.c
    trunk/blender/source/blender/python/intern/bpy_rna.c
    trunk/blender/source/blender/python/intern/bpy_rna_anim.c
    trunk/blender/source/blender/python/intern/bpy_rna_array.c
    trunk/blender/source/blender/python/intern/bpy_traceback.c
    trunk/blender/source/blender/python/intern/bpy_util.c
    trunk/blender/source/blender/python/intern/gpu.c

Modified: trunk/blender/source/blender/python/bmesh/bmesh_py_types.c
===================================================================
--- trunk/blender/source/blender/python/bmesh/bmesh_py_types.c	2012-03-26 19:50:45 UTC (rev 45189)
+++ trunk/blender/source/blender/python/bmesh/bmesh_py_types.c	2012-03-26 20:41:54 UTC (rev 45190)
@@ -3054,8 +3054,8 @@
 	}
 	else {
 		PyErr_Format(PyExc_ReferenceError,
-					 "BMesh data of type %.200s has been removed",
-					 Py_TYPE(self)->tp_name);
+		             "BMesh data of type %.200s has been removed",
+		             Py_TYPE(self)->tp_name);
 		return -1;
 	}
 }

Modified: trunk/blender/source/blender/python/bmesh/bmesh_py_types_customdata.c
===================================================================
--- trunk/blender/source/blender/python/bmesh/bmesh_py_types_customdata.c	2012-03-26 19:50:45 UTC (rev 45189)
+++ trunk/blender/source/blender/python/bmesh/bmesh_py_types_customdata.c	2012-03-26 20:41:54 UTC (rev 45190)
@@ -712,7 +712,7 @@
 
 /**
  * helper function for get/set, NULL return means the error is set
-*/
+ */
 static void *bpy_bmlayeritem_ptr_get(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer)
 {
 	void *value;
@@ -746,7 +746,7 @@
 	if (UNLIKELY(value == NULL)) {
 		/* this should be fairly unlikely but possible if layers move about after we get them */
 		PyErr_SetString(PyExc_KeyError,
-		             "BMElem[key]: layer not found");
+		                "BMElem[key]: layer not found");
 		return NULL;
 	}
 	else {

Modified: trunk/blender/source/blender/python/intern/bpy.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy.c	2012-03-26 19:50:45 UTC (rev 45189)
+++ trunk/blender/source/blender/python/intern/bpy.c	2012-03-26 20:41:54 UTC (rev 45190)
@@ -52,7 +52,7 @@
 
 #include "MEM_guardedalloc.h"
 
- /* external util modules */
+/* external util modules */
 #include "../generic/idprop_py_api.h"
 #include "../generic/bgl.h"
 #include "../generic/blf_py_api.h"
@@ -211,11 +211,11 @@
 static PyMethodDef meth_bpy_script_paths =
 	{"script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc};
 static PyMethodDef meth_bpy_blend_paths =
-	{"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc};
+	{"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS | METH_KEYWORDS, bpy_blend_paths_doc};
 static PyMethodDef meth_bpy_user_resource =
-	{"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, NULL};
+	{"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS | METH_KEYWORDS, NULL};
 static PyMethodDef meth_bpy_resource_path =
-	{"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS|METH_KEYWORDS, bpy_resource_path_doc};
+	{"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS | METH_KEYWORDS, bpy_resource_path_doc};
 
 
 static PyObject *bpy_import_test(const char *modname)
@@ -279,7 +279,7 @@
 	PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */
 	bpy_import_test("bpy_types");
 	PyModule_AddObject(mod, "props", BPY_rna_props());	
-	 /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */
+	/* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */
 	PyModule_AddObject(mod, "ops", BPY_operator_module());
 	PyModule_AddObject(mod, "app", BPY_app_struct());
 

Modified: trunk/blender/source/blender/python/intern/bpy_app.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_app.c	2012-03-26 19:50:45 UTC (rev 45189)
+++ trunk/blender/source/blender/python/intern/bpy_app.c	2012-03-26 20:41:54 UTC (rev 45190)
@@ -223,10 +223,11 @@
 );
 static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(closure))
 {
-	if (bpy_pydriver_Dict == NULL)
+	if (bpy_pydriver_Dict == NULL) {
 		if (bpy_pydriver_create_dict() != 0) {
 			PyErr_SetString(PyExc_RuntimeError, "bpy.app.driver_namespace failed to create dictionary");
 			return NULL;
+		}
 	}
 
 	Py_INCREF(bpy_pydriver_Dict);

Modified: trunk/blender/source/blender/python/intern/bpy_app_ffmpeg.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_app_ffmpeg.c	2012-03-26 19:50:45 UTC (rev 45189)
+++ trunk/blender/source/blender/python/intern/bpy_app_ffmpeg.c	2012-03-26 20:41:54 UTC (rev 45190)
@@ -88,16 +88,18 @@
 	PyStructSequence_SET_ITEM(ffmpeg_info, pos++, obj)
 
 #ifdef WITH_FFMPEG
-	#define FFMPEG_LIB_VERSION(lib) \
+#  define FFMPEG_LIB_VERSION(lib)  { \
 		curversion = lib ## _version(); \
 		SetObjItem(Py_BuildValue("(iii)", \
-				curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
+		                         curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
 		SetObjItem(PyUnicode_FromFormat("%2d, %2d, %2d", \
-				curversion >> 16, (curversion >> 8) % 256, curversion % 256));
+		                                curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
+} (void)0
 #else
-	#define FFMPEG_LIB_VERSION(lib) \
+#  define FFMPEG_LIB_VERSION(lib)  { \
 		SetStrItem("Unknown"); \
-		SetStrItem("Unknown");
+		SetStrItem("Unknown"); \
+} (void)0
 #endif
 
 #ifdef WITH_FFMPEG

Modified: trunk/blender/source/blender/python/intern/bpy_app_handlers.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_app_handlers.c	2012-03-26 19:50:45 UTC (rev 45189)
+++ trunk/blender/source/blender/python/intern/bpy_app_handlers.c	2012-03-26 20:41:54 UTC (rev 45190)
@@ -71,7 +71,7 @@
 };
 
 #if 0
-#  if (BLI_CB_EVT_TOT != ((sizeof(app_cb_info_fields)/sizeof(PyStructSequence_Field))))
+#  if (BLI_CB_EVT_TOT != ((sizeof(app_cb_info_fields) / sizeof(PyStructSequence_Field))))
 #    error "Callbacks are out of sync"
 #  endif
 #endif
@@ -118,51 +118,51 @@
 static PyTypeObject BPyPersistent_Type = {
 
 #if defined(_MSC_VER) || defined(FREE_WINDOWS)
-    PyVarObject_HEAD_INIT(NULL, 0)
+	PyVarObject_HEAD_INIT(NULL, 0)
 #else
-    PyVarObject_HEAD_INIT(&PyType_Type, 0)
+	PyVarObject_HEAD_INIT(&PyType_Type, 0)
 #endif
 
-    "persistent",                               /* tp_name */
-    0,                                          /* tp_basicsize */
-    0,                                          /* tp_itemsize */
-    /* methods */
-    0,                                          /* tp_dealloc */
-    0,                                          /* tp_print */
-    0,                                          /* tp_getattr */
-    0,                                          /* tp_setattr */
-    0,                                          /* tp_reserved */
-    0,                                          /* tp_repr */
-    0,                                          /* tp_as_number */
-    0,                                          /* tp_as_sequence */
-    0,                                          /* tp_as_mapping */
-    0,                                          /* tp_hash */
-    0,                                          /* tp_call */
-    0,                                          /* tp_str */
-    0,                                          /* tp_getattro */
-    0,                                          /* tp_setattro */
-    0,                                          /* tp_as_buffer */
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
-        Py_TPFLAGS_BASETYPE,                    /* tp_flags */
-    0,                                          /* tp_doc */
-    0,                                          /* tp_traverse */
-    0,                                          /* tp_clear */
-    0,                                          /* tp_richcompare */
-    0,                                          /* tp_weaklistoffset */
-    0,                                          /* tp_iter */
-    0,                                          /* tp_iternext */
-    0,                                          /* tp_methods */
-    0,                                          /* tp_members */
-    0,                                          /* tp_getset */
-    0,                                          /* tp_base */
-    0,                                          /* tp_dict */
-    0,                                          /* tp_descr_get */
-    0,                                          /* tp_descr_set */
-    0,                                          /* tp_dictoffset */
-    0,                                          /* tp_init */
-    0,                                          /* tp_alloc */
-    bpy_app_handlers_persistent_new,            /* tp_new */
-    0,                                          /* tp_free */
+	"persistent",                               /* tp_name */
+	0,                                          /* tp_basicsize */
+	0,                                          /* tp_itemsize */
+	/* methods */
+	0,                                          /* tp_dealloc */
+	0,                                          /* tp_print */
+	0,                                          /* tp_getattr */
+	0,                                          /* tp_setattr */
+	0,                                          /* tp_reserved */
+	0,                                          /* tp_repr */
+	0,                                          /* tp_as_number */
+	0,                                          /* tp_as_sequence */
+	0,                                          /* tp_as_mapping */
+	0,                                          /* tp_hash */
+	0,                                          /* tp_call */
+	0,                                          /* tp_str */
+	0,                                          /* tp_getattro */
+	0,                                          /* tp_setattro */
+	0,                                          /* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+	Py_TPFLAGS_BASETYPE,                        /* tp_flags */
+	0,                                          /* tp_doc */
+	0,                                          /* tp_traverse */
+	0,                                          /* tp_clear */
+	0,                                          /* tp_richcompare */
+	0,                                          /* tp_weaklistoffset */
+	0,                                          /* tp_iter */

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list