Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2009-03-05 11:53:29 +0300
committerNathan Letwory <nathan@letworyinteractive.com>2009-03-05 11:53:29 +0300
commit0229621b512507fabcad8634bcfc02d131ec9450 (patch)
tree0fd5388d257c7cc12e208c3d776ad60c44c1d6af /source/blender/python/intern
parent63ae590f4425a9b2ef3f447f2cf30d7defc8ce10 (diff)
2.5 / PyRNA
* a collection of small changes after review together with Campbell.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r--source/blender/python/intern/bpy_rna.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index e879be52be6..340e0cc8cb7 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -120,8 +120,7 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
PyObject *ret;
int type = RNA_property_type(ptr, prop);
int len = RNA_property_array_length(ptr, prop);
- /* resolve path */
-
+
if (len > 0) {
/* resolve the array from a new pytype */
return pyrna_prop_CreatePyObject(ptr, prop);
@@ -154,7 +153,7 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
if (RNA_property_enum_identifier(ptr, prop, val, &identifier)) {
ret = PyUnicode_FromString( identifier );
} else {
- PyErr_Format(PyExc_AttributeError, "enum \"%d\" not found", val);
+ PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val);
ret = NULL;
}
@@ -173,10 +172,11 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
break;
}
case PROP_COLLECTION:
- ret = pyrna_prop_CreatePyObject(ptr, prop);
+ PyErr_SetString(PyExc_AttributeError, "RNA Anomaly: Collection of length 0?");
+ ret = NULL; /*pyrna_prop_CreatePyObject(ptr, prop);*/
break;
default:
- PyErr_SetString(PyExc_AttributeError, "unknown type (pyrna_prop_to_py)");
+ PyErr_Format(PyExc_AttributeError, "RNA Error: unknown type \"%d\" (pyrna_prop_to_py)", type);
ret = NULL;
break;
}
@@ -189,7 +189,6 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, PyObject *value)
{
int type = RNA_property_type(ptr, prop);
int len = RNA_property_array_length(ptr, prop);
- /* resolve path */
if (len > 0) {
PyObject *item;
@@ -374,8 +373,6 @@ static PyObject * pyrna_prop_to_py_index(PointerRNA *ptr, PropertyRNA *prop, int
PyObject *ret;
int type = RNA_property_type(ptr, prop);
- /* resolve path */
-
/* see if we can coorce into a python type - PropertyType */
switch (type) {
case PROP_BOOLEAN:
@@ -401,8 +398,6 @@ static int pyrna_py_to_prop_index(PointerRNA *ptr, PropertyRNA *prop, int index,
int ret = 0;
int type = RNA_property_type(ptr, prop);
- /* resolve path */
-
/* see if we can coorce into a python type - PropertyType */
switch (type) {
case PROP_BOOLEAN: