diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-08-14 07:23:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-08-14 07:23:36 +0400 |
commit | 3f2cb6e87855e4afc2e26d87f36817a92490429e (patch) | |
tree | 8c9af32f0aa1e42a08cc6d9d2aac3f1c6c052535 /source/gameengine/Expressions/Value.cpp | |
parent | d2750f7bda1e5e4e43df330ab49e677105e00d4f (diff) |
game engine python api
* removed macros that were not used much, some misleading.
* removed error string setting calls that overwrote the error set by PyArg_ParseTuple with a less useful one.
* use python macros Py_RETURN_NONE, Py_RETURN_TRUE, Py_RETURN_FALSE
Diffstat (limited to 'source/gameengine/Expressions/Value.cpp')
-rw-r--r-- | source/gameengine/Expressions/Value.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index b4694740679..7bcb45228db 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -158,15 +158,14 @@ PyParentObject CValue::Parents[] = { }; PyMethodDef CValue::Methods[] = { -// { "printHello", (PyCFunction) CValue::sPyPrintHello, Py_NEWARGS}, - { "getName", (PyCFunction) CValue::sPyGetName, Py_NEWARGS}, +// { "printHello", (PyCFunction) CValue::sPyPrintHello, METH_VARARGS}, + { "getName", (PyCFunction) CValue::sPyGetName, METH_NOARGS}, {NULL,NULL} //Sentinel }; -PyObject* CValue::PyGetName(PyObject* self,PyObject* args,PyObject* kwds) +PyObject* CValue::PyGetName(PyObject* self) { - PyObject* pyname = PyString_FromString(this->GetName()); - return pyname; + return PyString_FromString(this->GetName()); } /*#define CVALUE_DEBUG*/ @@ -662,7 +661,7 @@ CValue* CValue::FindIdentifier(const STR_String& identifiername) static PyMethodDef CValueMethods[] = { - //{ "new", CValue::PyMake , Py_NEWARGS}, + //{ "new", CValue::PyMake , METH_VARARGS}, { NULL,NULL} // Sentinel }; @@ -806,9 +805,8 @@ PyObject* CValue::ConvertKeysToPython( void ) PyObject* CValue::PyMake(PyObject* ignored,PyObject* args) { - //Py_Try(PyArg_ParseTuple(args,"s",&name)); - Py_INCREF(Py_None); - return Py_None;//new CValue(); + //if (!PyArg_ParseTuple(args,"s",&name)) return NULL; + Py_RETURN_NONE;//new CValue(); } */ |