[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37576] trunk/blender/source/blender/ python/intern/bpy_rna_array.c: ulti line formatting for PyErr_Format calls (no functional change)
Campbell Barton
ideasman42 at gmail.com
Fri Jun 17 04:26:34 CEST 2011
Revision: 37576
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37576
Author: campbellbarton
Date: 2011-06-17 02:26:34 +0000 (Fri, 17 Jun 2011)
Log Message:
-----------
ulti line formatting for PyErr_Format calls (no functional change)
Modified Paths:
--------------
trunk/blender/source/blender/python/intern/bpy_rna_array.c
Modified: trunk/blender/source/blender/python/intern/bpy_rna_array.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna_array.c 2011-06-17 02:22:38 UTC (rev 37575)
+++ trunk/blender/source/blender/python/intern/bpy_rna_array.c 2011-06-17 02:26:34 UTC (rev 37576)
@@ -68,7 +68,8 @@
/* check that a sequence contains dimsize[dim] items */
const int seq_size= PySequence_Size(seq);
if(seq_size == -1) {
- PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not '%s'", error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
+ PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not '%s'",
+ error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
return -1;
}
for (i= 0; i < seq_size; i++) {
@@ -77,12 +78,14 @@
item= PySequence_GetItem(seq, i);
if(item == NULL) {
- PyErr_Format(PyExc_TypeError, "%s sequence type '%s' failed to retrieve index %d", error_prefix, Py_TYPE(seq)->tp_name, i);
+ PyErr_Format(PyExc_TypeError, "%s sequence type '%s' failed to retrieve index %d",
+ error_prefix, Py_TYPE(seq)->tp_name, i);
ok= 0;
}
else if (!PySequence_Check(item)) {
/* BLI_snprintf(error_str, error_str_size, "expected a sequence of %s", item_type_str); */
- PyErr_Format(PyExc_TypeError, "%s expected a sequence of %s, not %s", error_prefix, item_type_str, Py_TYPE(item)->tp_name);
+ PyErr_Format(PyExc_TypeError, "%s expected a sequence of %s, not %s",
+ error_prefix, item_type_str, Py_TYPE(item)->tp_name);
ok= 0;
}
/* arr[3][4][5]
@@ -92,7 +95,8 @@
dim=0 */
else if (PySequence_Size(item) != dimsize[dim + 1]) {
/* BLI_snprintf(error_str, error_str_size, "sequences of dimension %d should contain %d items", (int)dim + 1, (int)dimsize[dim + 1]); */
- PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items", error_prefix, (int)dim + 1, (int)dimsize[dim + 1]);
+ PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items",
+ error_prefix, (int)dim + 1, (int)dimsize[dim + 1]);
ok= 0;
}
else if (validate_array_type(item, dim + 1, totdim, dimsize, check_item_type, item_type_str, error_prefix) == -1) {
@@ -109,21 +113,24 @@
/* check that items are of correct type */
const int seq_size= PySequence_Size(seq);
if(seq_size == -1) {
- PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not '%s'", error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
+ PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not '%s'",
+ error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
return -1;
}
for (i= 0; i < seq_size; i++) {
PyObject *item= PySequence_GetItem(seq, i);
if(item == NULL) {
- PyErr_Format(PyExc_TypeError, "%s sequence type '%s' failed to retrieve index %d", error_prefix, Py_TYPE(seq)->tp_name, i);
+ PyErr_Format(PyExc_TypeError, "%s sequence type '%s' failed to retrieve index %d",
+ error_prefix, Py_TYPE(seq)->tp_name, i);
return -1;
}
else if (!check_item_type(item)) {
Py_DECREF(item);
/* BLI_snprintf(error_str, error_str_size, "sequence items should be of type %s", item_type_str); */
- PyErr_Format(PyExc_TypeError, "%s expected sequence items of type %s, not %s", error_prefix, item_type_str, Py_TYPE(item)->tp_name);
+ PyErr_Format(PyExc_TypeError, "%s expected sequence items of type %s, not %s",
+ error_prefix, item_type_str, Py_TYPE(item)->tp_name);
return -1;
}
@@ -178,7 +185,8 @@
tot= count_items(rvalue, totdim - lvalue_dim);
if(tot == -1) {
- PyErr_Format(PyExc_ValueError, "%s %.200s.%.200s, error validating the sequence length", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop));
+ PyErr_Format(PyExc_ValueError, "%s %.200s.%.200s, error validating the sequence length",
+ error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop));
return -1;
}
else if ((RNA_property_flag(prop) & PROP_DYNAMIC) && lvalue_dim == 0) {
@@ -187,7 +195,8 @@
/* length is flexible */
if (!RNA_property_dynamic_array_set_length(ptr, prop, tot)) {
/* BLI_snprintf(error_str, error_str_size, "%s.%s: array length cannot be changed to %d", RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); */
- PyErr_Format(PyExc_ValueError, "%s %s.%s: array length cannot be changed to %d", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot);
+ PyErr_Format(PyExc_ValueError, "%s %s.%s: array length cannot be changed to %d",
+ error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot);
return -1;
}
#else
@@ -229,7 +238,8 @@
if (tot != len) {
/* BLI_snprintf(error_str, error_str_size, "sequence must have length of %d", len); */
- PyErr_Format(PyExc_ValueError, "%s %.200s.%.200s, sequence must have %d items total, not %d", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), len, tot);
+ PyErr_Format(PyExc_ValueError, "%s %.200s.%.200s, sequence must have %d items total, not %d",
+ error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), len, tot);
return -1;
}
}
@@ -350,7 +360,8 @@
PyMem_FREE(data);
}
- PyErr_Format(PyExc_TypeError, "%s internal error parsing sequence of type '%s' after successful validation", error_prefix, Py_TYPE(seq)->tp_name);
+ PyErr_Format(PyExc_TypeError, "%s internal error parsing sequence of type '%s' after successful validation",
+ error_prefix, Py_TYPE(seq)->tp_name);
return -1;
}
}
@@ -384,7 +395,10 @@
if(lvalue_dim == totdim) { /* single item, assign directly */
if(!check_item_type(py)) {
- PyErr_Format(PyExc_TypeError, "%s %.200s.%.200s, expected a %s type, not %s", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), item_type_str, Py_TYPE(py)->tp_name);
+ PyErr_Format(PyExc_TypeError, "%s %.200s.%.200s, expected a %s type, not %s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), item_type_str,
+ Py_TYPE(py)->tp_name);
return -1;
}
copy_value_single(py, ptr, prop, NULL, 0, &index, convert_item, rna_set_index);
More information about the Bf-blender-cvs
mailing list