diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-04-10 20:45:19 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-04-10 20:45:19 +0400 |
commit | 2fff90bbb4a922f454c15dbf2d6215bd4d8c519c (patch) | |
tree | dfc2955a85c8f0fe61eaa9716eee8f6341c1197b /source/gameengine/GameLogic | |
parent | a412ce0702101628ac827d53465354c05fed7927 (diff) |
Added function name to many of the PyArg_ParseTuple calls in gameengine
This way python raises more useful messages.
Diffstat (limited to 'source/gameengine/GameLogic')
11 files changed, 35 insertions, 35 deletions
diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 945d473f937..99f3788ad2e 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -204,7 +204,7 @@ PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* self, PyObject* args, PyOb /* on the fly? */ char *actNameArg = NULL; - if (!PyArg_ParseTuple(args, "s", &actNameArg)) { + if (!PyArg_ParseTuple(args, "s:setActuator", &actNameArg)) { return NULL; } diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index 25161d21e72..3f08f301dc1 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -197,7 +197,7 @@ PyObject* SCA_DelaySensor::PySetDelay(PyObject* self, PyObject* args, PyObject* ShowDeprecationWarning("setDelay()", "the delay property"); int delay; - if(!PyArg_ParseTuple(args, "i", &delay)) { + if(!PyArg_ParseTuple(args, "i:setDelay", &delay)) { return NULL; } if (delay < 0) { @@ -219,7 +219,7 @@ PyObject* SCA_DelaySensor::PySetDuration(PyObject* self, PyObject* args, PyObjec ShowDeprecationWarning("setDuration()", "the duration property"); int duration; - if(!PyArg_ParseTuple(args, "i", &duration)) { + if(!PyArg_ParseTuple(args, "i:setDuration", &duration)) { return NULL; } if (duration < 0) { @@ -240,7 +240,7 @@ PyObject* SCA_DelaySensor::PySetRepeat(PyObject* self, PyObject* args, PyObject* ShowDeprecationWarning("setRepeat()", "the repeat property"); int repeat; - if(!PyArg_ParseTuple(args, "i", &repeat)) { + if(!PyArg_ParseTuple(args, "i:setRepeat", &repeat)) { return NULL; } m_repeat = (repeat != 0); diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 4b1f8b52bf5..900975b9f15 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -312,7 +312,7 @@ PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* self, int priority=0; - if (!PyArg_ParseTuple(args, "i", &priority)) { + if (!PyArg_ParseTuple(args, "i:setExecutePriority", &priority)) { return NULL; } diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 80d42d8344d..bb1f73bf7f9 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -262,7 +262,7 @@ PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* self, PyObject* args, PyOb { ShowDeprecationWarning("setUsePosPulseMode()", "the usePosPulseMode property"); int pyarg = 0; - if(!PyArg_ParseTuple(args, "i", &pyarg)) { return NULL; } + if(!PyArg_ParseTuple(args, "i:setUsePosPulseMode", &pyarg)) { return NULL; } m_pos_pulsemode = PyArgToBool(pyarg); Py_RETURN_NONE; } @@ -292,7 +292,7 @@ PyObject* SCA_ISensor::PySetFrequency(PyObject* self, PyObject* args, PyObject* ShowDeprecationWarning("setFrequency()", "the frequency property"); int pulse_frequencyArg = 0; - if(!PyArg_ParseTuple(args, "i", &pulse_frequencyArg)) { + if(!PyArg_ParseTuple(args, "i:setFrequency", &pulse_frequencyArg)) { return NULL; } @@ -324,7 +324,7 @@ PyObject* SCA_ISensor::PySetInvert(PyObject* self, PyObject* args, PyObject* kwd { ShowDeprecationWarning("setInvert()", "the invert property"); int pyarg = 0; - if(!PyArg_ParseTuple(args, "i", &pyarg)) { return NULL; } + if(!PyArg_ParseTuple(args, "i:setInvert", &pyarg)) { return NULL; } m_invert = PyArgToBool(pyarg); Py_RETURN_NONE; } @@ -350,7 +350,7 @@ PyObject* SCA_ISensor::PySetLevel(PyObject* self, PyObject* args, PyObject* kwds { ShowDeprecationWarning("setLevel()", "the level property"); int pyarg = 0; - if(!PyArg_ParseTuple(args, "i", &pyarg)) { return NULL; } + if(!PyArg_ParseTuple(args, "i:setLevel", &pyarg)) { return NULL; } m_level = PyArgToBool(pyarg); Py_RETURN_NONE; } @@ -373,7 +373,7 @@ PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* self, PyObject* args, PyOb { ShowDeprecationWarning("setUseNegPulseMode()", "the useNegPulseMode property"); int pyarg = 0; - if(!PyArg_ParseTuple(args, "i", &pyarg)) { return NULL; } + if(!PyArg_ParseTuple(args, "i:setUseNegPulseMode", &pyarg)) { return NULL; } m_neg_pulsemode = PyArgToBool(pyarg); Py_RETURN_NONE; } diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index fa61e057b2c..9cf850ceb3e 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -389,7 +389,7 @@ PyObject* SCA_JoystickSensor::PySetAxis( PyObject* self, PyObject* args ) { ShowDeprecationWarning("setAxis()", "the axis property"); int axis,axisflag; - if(!PyArg_ParseTuple(args, "ii", &axis, &axisflag)){ + if(!PyArg_ParseTuple(args, "ii:setAxis", &axis, &axisflag)){ return NULL; } m_axis = axis; @@ -434,7 +434,7 @@ const char SCA_JoystickSensor::SetThreshold_doc[] = PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* self, PyObject* args ) { ShowDeprecationWarning("setThreshold()", "the threshold property"); int thresh; - if(!PyArg_ParseTuple(args, "i", &thresh)){ + if(!PyArg_ParseTuple(args, "i:setThreshold", &thresh)){ return NULL; } m_precision = thresh; @@ -504,7 +504,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* self, PyObject* args SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); int index; - if(!PyArg_ParseTuple(args, "i", &index)){ + if(!PyArg_ParseTuple(args, "i:getButtonStatus", &index)){ return NULL; } if(joy && index >= 0 && index < joy->GetNumberOfButtons()) { @@ -530,7 +530,7 @@ const char SCA_JoystickSensor::SetHat_doc[] = PyObject* SCA_JoystickSensor::PySetHat( PyObject* self, PyObject* args ) { ShowDeprecationWarning("setHat()", "the hat property"); int hat,hatflag; - if(!PyArg_ParseTuple(args, "ii", &hat, &hatflag)){ + if(!PyArg_ParseTuple(args, "ii:setHat", &hat, &hatflag)){ return NULL; } m_hat = hat; diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index ecdf889124d..0bf19360b15 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -428,7 +428,7 @@ PyObject* SCA_KeyboardSensor::PySetKey(PyObject* self, PyObject* args, PyObject* ShowDeprecationWarning("setKey()", "the key property"); int keyCode; - if(!PyArg_ParseTuple(args, "i", &keyCode)) { + if(!PyArg_ParseTuple(args, "i:setKey", &keyCode)) { return NULL; } @@ -460,7 +460,7 @@ PyObject* SCA_KeyboardSensor::PySetHold1(PyObject* self, PyObject* args, PyObjec ShowDeprecationWarning("setHold1()", "the hold1 property"); int keyCode; - if(!PyArg_ParseTuple(args, "i", &keyCode)) { + if(!PyArg_ParseTuple(args, "i:setHold1", &keyCode)) { return NULL; } @@ -492,7 +492,7 @@ PyObject* SCA_KeyboardSensor::PySetHold2(PyObject* self, PyObject* args, PyObjec ShowDeprecationWarning("setHold2()", "the hold2 property"); int keyCode; - if(!PyArg_ParseTuple(args, "i", &keyCode)) { + if(!PyArg_ParseTuple(args, "i:setHold2", &keyCode)) { return NULL; } diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index fa8763a3932..444c616870d 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -279,7 +279,7 @@ PyObject* SCA_PropertyActuator::PySetProperty(PyObject* self, PyObject* args, Py ShowDeprecationWarning("setProperty()", "the 'property' property"); /* Check whether the name exists first ! */ char *nameArg; - if (!PyArg_ParseTuple(args, "s", &nameArg)) { + if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) { return NULL; } @@ -316,7 +316,7 @@ PyObject* SCA_PropertyActuator::PySetValue(PyObject* self, PyObject* args, PyObj { ShowDeprecationWarning("setValue()", "the value property"); char *valArg; - if(!PyArg_ParseTuple(args, "s", &valArg)) { + if(!PyArg_ParseTuple(args, "s:setValue", &valArg)) { return NULL; } diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 164e94b6597..9ae7be16b12 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -382,7 +382,7 @@ PyObject* SCA_PropertySensor::PySetType(PyObject* self, PyObject* args, PyObject ShowDeprecationWarning("setType()", "the type property"); int typeArg; - if (!PyArg_ParseTuple(args, "i", &typeArg)) { + if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { return NULL; } @@ -417,7 +417,7 @@ PyObject* SCA_PropertySensor::PySetProperty(PyObject* self, PyObject* args, PyOb /* on the fly? */ char *propNameArg = NULL; - if (!PyArg_ParseTuple(args, "s", &propNameArg)) { + if (!PyArg_ParseTuple(args, "s:setProperty", &propNameArg)) { return NULL; } @@ -455,7 +455,7 @@ PyObject* SCA_PropertySensor::PySetValue(PyObject* self, PyObject* args, PyObjec /* We know that the property exists, or is NULL. */ char *propValArg = NULL; - if(!PyArg_ParseTuple(args, "s", &propValArg)) { + if(!PyArg_ParseTuple(args, "s:setValue", &propValArg)) { return NULL; } STR_String oldval = m_checkpropval; diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 3c2a1d09f82..0e6b9d1e8f1 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -205,7 +205,7 @@ PyObject* SCA_PythonController::sPyAddActiveActuator( PyObject* ob1; int activate; - if (!PyArg_ParseTuple(args, "Oi", &ob1,&activate)) + if (!PyArg_ParseTuple(args, "Oi:addActiveActuator", &ob1,&activate)) return NULL; SCA_IActuator* actu = LinkedActuatorFromPy(ob1); diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index b1c0c7fec99..d5d993c4ba6 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -410,7 +410,7 @@ const char SCA_RandomActuator::SetSeed_doc[] = PyObject* SCA_RandomActuator::PySetSeed(PyObject* self, PyObject* args, PyObject* kwds) { ShowDeprecationWarning("setSeed()", "the seed property"); long seedArg; - if(!PyArg_ParseTuple(args, "i", &seedArg)) { + if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) { return NULL; } @@ -468,7 +468,7 @@ const char SCA_RandomActuator::SetProperty_doc[] = PyObject* SCA_RandomActuator::PySetProperty(PyObject* self, PyObject* args, PyObject* kwds) { ShowDeprecationWarning("setProperty()", "the 'property' property"); char *nameArg; - if (!PyArg_ParseTuple(args, "s", &nameArg)) { + if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) { return NULL; } @@ -500,7 +500,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setBoolConst, "\tSet this generator to produce a constant boolean value.\n") { int paraArg; - if(!PyArg_ParseTuple(args, "i", ¶Arg)) { + if(!PyArg_ParseTuple(args, "i:setBoolConst", ¶Arg)) { return NULL; } @@ -526,7 +526,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setBoolBernouilli, "\tReturn false value * 100%% of the time.\n") { float paraArg; - if(!PyArg_ParseTuple(args, "f", ¶Arg)) { + if(!PyArg_ParseTuple(args, "f:setBoolBernouilli", ¶Arg)) { return NULL; } @@ -542,7 +542,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setIntConst, "\tAlways return value\n") { int paraArg; - if(!PyArg_ParseTuple(args, "i", ¶Arg)) { + if(!PyArg_ParseTuple(args, "i:setIntConst", ¶Arg)) { return NULL; } @@ -560,7 +560,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setIntUniform, "\tupper_bound. The boundaries are included.\n") { int paraArg1, paraArg2; - if(!PyArg_ParseTuple(args, "ii", ¶Arg1, ¶Arg2)) { + if(!PyArg_ParseTuple(args, "ii:setIntUniform", ¶Arg1, ¶Arg2)) { return NULL; } @@ -579,7 +579,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setIntPoisson, "\tnumber of tries needed to achieve succes.\n") { float paraArg; - if(!PyArg_ParseTuple(args, "f", ¶Arg)) { + if(!PyArg_ParseTuple(args, "f:setIntPoisson", ¶Arg)) { return NULL; } @@ -595,7 +595,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setFloatConst, "\tAlways return value\n") { float paraArg; - if(!PyArg_ParseTuple(args, "f", ¶Arg)) { + if(!PyArg_ParseTuple(args, "f:setFloatConst", ¶Arg)) { return NULL; } @@ -613,7 +613,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setFloatUniform, "\tupper_bound.\n") { float paraArg1, paraArg2; - if(!PyArg_ParseTuple(args, "ff", ¶Arg1, ¶Arg2)) { + if(!PyArg_ParseTuple(args, "ff:setFloatUniform", ¶Arg1, ¶Arg2)) { return NULL; } @@ -632,7 +632,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setFloatNormal, "\tdeviation from the mean is characterized by standard_deviation.\n") { float paraArg1, paraArg2; - if(!PyArg_ParseTuple(args, "ff", ¶Arg1, ¶Arg2)) { + if(!PyArg_ParseTuple(args, "ff:setFloatNormal", ¶Arg1, ¶Arg2)) { return NULL; } @@ -650,7 +650,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setFloatNegativeExponential, "\tis characterized by half_life.\n") { float paraArg; - if(!PyArg_ParseTuple(args, "f", ¶Arg)) { + if(!PyArg_ParseTuple(args, "f:setFloatNegativeExponential", ¶Arg)) { return NULL; } diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index fe4d88e2797..3179c8522f9 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -185,7 +185,7 @@ const char SCA_RandomSensor::SetSeed_doc[] = PyObject* SCA_RandomSensor::PySetSeed(PyObject* self, PyObject* args, PyObject* kwds) { ShowDeprecationWarning("setSeed()", "the seed property"); long seedArg; - if(!PyArg_ParseTuple(args, "i", &seedArg)) { + if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) { return NULL; } |