[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17991] branches/blender2.5/blender/source /blender/python/intern/bpy_idprop.c: Adding back python 3.0 calls, they didn't build with py2.x because I missed including bpy_compat.h, tested building with 2.6

Campbell Barton ideasman42 at gmail.com
Sun Dec 21 13:40:02 CET 2008


Revision: 17991
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17991
Author:   campbellbarton
Date:     2008-12-21 13:40:02 +0100 (Sun, 21 Dec 2008)

Log Message:
-----------
Adding back python 3.0 calls, they didn't build with py2.x because I missed including bpy_compat.h, tested building with 2.6

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

Modified: branches/blender2.5/blender/source/blender/python/intern/bpy_idprop.c
===================================================================
--- branches/blender2.5/blender/source/blender/python/intern/bpy_idprop.c	2008-12-21 11:56:42 UTC (rev 17990)
+++ branches/blender2.5/blender/source/blender/python/intern/bpy_idprop.c	2008-12-21 12:40:02 UTC (rev 17991)
@@ -61,8 +61,8 @@
 	} else if (PyLong_Check(ob)) {
 		val.i = (int) PyLong_AsLong(ob);
 		prop = IDP_New(IDP_INT, val, name);
-	} else if (/*PyUnicode_Check(ob)*/0) {
-		//val.str = _PyUnicode_AsString(ob);
+	} else if (PyUnicode_Check(ob)) {
+		val.str = _PyUnicode_AsString(ob);
 		prop = IDP_New(IDP_STRING, val, name);
 	} else if (PySequence_Check(ob)) {
 		PyObject *item;
@@ -106,7 +106,7 @@
 		for (i=0; i<len; i++) {
 			key = PySequence_GetItem(keys, i);
 			pval = PySequence_GetItem(vals, i);
-			if (/*!PyUnicode_Check(key)*/1) {
+			if (!PyUnicode_Check(key)) {
 				IDP_FreeProperty(prop);
 				MEM_freeN(prop);
 				Py_XDECREF(keys);
@@ -115,7 +115,7 @@
 				Py_XDECREF(pval);
 				return "invalid element in subgroup dict template!";
 			}
-			if (/*BPy_IDProperty_Map_ValidateAndCreate(PyUnicode_AsString(key), prop, pval)*/0) {
+			if (BPy_IDProperty_Map_ValidateAndCreate(_PyUnicode_AsString(key), prop, pval)) {
 				IDP_FreeProperty(prop);
 				MEM_freeN(prop);
 				Py_XDECREF(keys);
@@ -144,12 +144,12 @@
 		return EXPP_ReturnIntError( PyExc_TypeError,
 			"unsubscriptable object");
 			
-	if (/*!PyUnicode_Check(key)*/1)
+	if (!PyUnicode_Check(key))
 		return EXPP_ReturnIntError( PyExc_TypeError,
 		   "only strings are allowed as subgroup keys" );
 
 	if (val == NULL) {
-		IDProperty *pkey = 0;//IDP_GetPropertyFromGroup(prop, PyUnicode_AsString(key));
+		IDProperty *pkey = IDP_GetPropertyFromGroup(prop, _PyUnicode_AsString(key));
 		if (pkey) {
 			IDP_RemFromGroup(prop, pkey);
 			IDP_FreeProperty(pkey);
@@ -158,7 +158,7 @@
 		} else return EXPP_ReturnIntError( PyExc_RuntimeError, "property not found in group" );
 	}
 	
-	//err = BPy_IDProperty_Map_ValidateAndCreate(_PyUnicode_AsString(key), prop, val);
+	err = BPy_IDProperty_Map_ValidateAndCreate(_PyUnicode_AsString(key), prop, val);
 	if (err) return EXPP_ReturnIntError( PyExc_RuntimeError, err );
 	
 	return 0;





More information about the Bf-blender-cvs mailing list