code cleanup: move sequencer timecode into its own func.

This commit is contained in:
2012-07-09 10:55:41 +00:00
parent 0966a3b191
commit 98969c64ff
3 changed files with 36 additions and 30 deletions
+6 -6
View File
@@ -2438,21 +2438,21 @@ static int bpy_bmelem_ass_subscript(BPy_BMElem *self, BPy_BMLayerItem *key, PyOb
}
static PySequenceMethods bpy_bmelemseq_as_sequence = {
(lenfunc)bpy_bmelemseq_length, /* sq_length */
(lenfunc)bpy_bmelemseq_length, /* sq_length */
NULL, /* sq_concat */
NULL, /* sq_repeat */
(ssizeargfunc)bpy_bmelemseq_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
(ssizeargfunc)bpy_bmelemseq_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
NULL, /* sq_slice */
(ssizeobjargproc)NULL, /* sq_ass_item */
NULL, /* *was* sq_ass_slice */
(objobjproc)bpy_bmelemseq_contains, /* sq_contains */
(objobjproc)bpy_bmelemseq_contains, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
(ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods bpy_bmelemseq_as_mapping = {
(lenfunc)bpy_bmelemseq_length, /* mp_length */
(binaryfunc)bpy_bmelemseq_subscript, /* mp_subscript */
(lenfunc)bpy_bmelemseq_length, /* mp_length */
(binaryfunc)bpy_bmelemseq_subscript, /* mp_subscript */
(objobjargproc)NULL, /* mp_ass_subscript */
};
@@ -2859,7 +2859,7 @@ static struct PyModuleDef BPy_BM_types_module_def = {
PyModuleDef_HEAD_INIT,
"bmesh.types", /* m_name */
NULL, /* m_doc */
0, /* m_size */
0, /* m_size */
NULL, /* m_methods */
NULL, /* m_reload */
NULL, /* m_traverse */
@@ -432,7 +432,7 @@ static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key,
/* dvert[group_index] = 0.5 */
if (i < 0) {
PyErr_SetString(PyExc_KeyError, "BMDeformVert[key] = x: "
"weight keys can't be negative");
"weight keys can't be negative");
return -1;
}
else {
@@ -440,8 +440,8 @@ static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key,
const float f = PyFloat_AsDouble(value);
if (f == -1 && PyErr_Occurred()) { // parsed key not a number
PyErr_SetString(PyExc_TypeError,
"BMDeformVert[key] = x: "
"argument not a number");
"BMDeformVert[key] = x: "
"argument not a number");
return -1;
}
@@ -496,7 +496,7 @@ static PySequenceMethods bpy_bmdeformvert_as_sequence = {
NULL, /* sq_slice */
NULL, /* sq_ass_item */
NULL, /* *was* sq_ass_slice */
(objobjproc)bpy_bmdeformvert_contains, /* sq_contains */
(objobjproc)bpy_bmdeformvert_contains, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
(ssizeargfunc) NULL, /* sq_inplace_repeat */
};