if (!toCall || !toCall->isValid()) { PyErr_SetString(PyExc_RuntimeError, "The function callback you specified was invalid."); return 0; }
static PyObject* wpAddtimer( PyObject* self, PyObject* args ){	Q_UNUSED( self );	Q_UINT32 expiretime;	PyObject* function;	PyObject* arguments;	uchar persistent = 0;	if ( !PyArg_ParseTuple( args, "iOO|B:item.addtimer", &expiretime, &function, &arguments, &persistent ) )		return 0;	PythonFunction* toCall = 0;	if ( !PyCallable_Check( function ) )	{		QString func = Python2QString( function );		if ( func.isNull() )		{			PyErr_SetString( PyExc_TypeError, "Bad argument on addtimer callback type" );			return 0;		}		Console::instance()->log( LOG_WARNING, tr("Using deprecated string as callback identifier [%1]").arg(func) );		toCall = new PythonFunction( func );	}	else		toCall = new PythonFunction( function );	if ( !PyList_Check( arguments ) )		return 0;	PyObject* py_args = PyList_AsTuple( arguments );	cPythonEffect* effect = new cPythonEffect( toCall, py_args );	// Should we save this effect?	effect->setSerializable( persistent != 0 );	effect->setExpiretime_ms( expiretime );	Timers::instance()->insert( effect );	Py_RETURN_NONE;}