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:
authorCampbell Barton <ideasman42@gmail.com>2009-04-07 20:00:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-07 20:00:32 +0400
commit18511c56d3cbfd0b368be61002960cc161cee526 (patch)
tree0809a4749ae64c1e34133a179b0bdd02a98c6f0c /source/gameengine/Expressions/ListValue.h
parent1534eca60f181dc4e4299f6bdf73a66bbdf87970 (diff)
BGE Python API (small changes)
- Make BGE's ListValue types convert to python lists for printing since the CValue GetText() function didnt work well- printing lists as [,,,,,] for scene objects and mesh materials for eg. - Check attributes are descriptor types before casting. - py_getattr_dict use the Type dict rather then Method and Attribute array.
Diffstat (limited to 'source/gameengine/Expressions/ListValue.h')
-rw-r--r--source/gameengine/Expressions/ListValue.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h
index f936298a8c4..1c01c2d221d 100644
--- a/source/gameengine/Expressions/ListValue.h
+++ b/source/gameengine/Expressions/ListValue.h
@@ -60,6 +60,12 @@ public:
bool CheckEqual(CValue* first,CValue* second);
virtual PyObject* py_getattro(PyObject* attr);
+ virtual PyObject* py_repr(void) {
+ PyObject *py_list= PySequence_List((PyObject *)this);
+ PyObject *py_string= PyObject_Repr(py_list);
+ Py_DECREF(py_list);
+ return py_string;
+ }
KX_PYMETHOD_O(CListValue,append);
KX_PYMETHOD_NOARGS(CListValue,reverse);