[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19196] branches/blender2.5/blender/source /blender/python/intern/bpy_rna.c: 2.5 / PyRNA

Nathan Letwory jesterking at letwory.net
Thu Mar 5 09:53:51 CET 2009


Revision: 19196
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19196
Author:   jesterking
Date:     2009-03-05 09:53:29 +0100 (Thu, 05 Mar 2009)

Log Message:
-----------
2.5 / PyRNA
* a collection of small changes after review together with Campbell.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c

Modified: branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c	2009-03-05 00:23:02 UTC (rev 19195)
+++ branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c	2009-03-05 08:53:29 UTC (rev 19196)
@@ -120,8 +120,7 @@
 	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 @@
 		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 @@
 		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 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 @@
 	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 @@
 	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:





More information about the Bf-blender-cvs mailing list