Some Ipo getseters calling setter methods; added the necessary wrapper
functions to make this work correctly.
This commit is contained in:
@@ -92,9 +92,11 @@ struct PyMethodDef M_Ipo_methods[] = {
|
|||||||
/* Python BPy_Ipo methods declarations: */
|
/* Python BPy_Ipo methods declarations: */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
static PyObject *Ipo_getName( BPy_Ipo * self );
|
static PyObject *Ipo_getName( BPy_Ipo * self );
|
||||||
static PyObject *Ipo_setName( BPy_Ipo * self, PyObject * args );
|
static PyObject *Ipo_oldsetName( BPy_Ipo * self, PyObject * args );
|
||||||
|
static int Ipo_setName( BPy_Ipo * self, PyObject * args );
|
||||||
static PyObject *Ipo_getBlocktype( BPy_Ipo * self );
|
static PyObject *Ipo_getBlocktype( BPy_Ipo * self );
|
||||||
static PyObject *Ipo_setBlocktype( BPy_Ipo * self, PyObject * args );
|
static PyObject *Ipo_oldsetBlocktype( BPy_Ipo * self, PyObject * args );
|
||||||
|
static int Ipo_setBlocktype( BPy_Ipo * self, PyObject * args );
|
||||||
static PyObject *Ipo_getRctf( BPy_Ipo * self );
|
static PyObject *Ipo_getRctf( BPy_Ipo * self );
|
||||||
static PyObject *Ipo_oldsetRctf( BPy_Ipo * self, PyObject * args );
|
static PyObject *Ipo_oldsetRctf( BPy_Ipo * self, PyObject * args );
|
||||||
static int Ipo_setRctf( BPy_Ipo * self, PyObject * args );
|
static int Ipo_setRctf( BPy_Ipo * self, PyObject * args );
|
||||||
@@ -130,11 +132,11 @@ static PyMethodDef BPy_Ipo_methods[] = {
|
|||||||
/* name, method, flags, doc */
|
/* name, method, flags, doc */
|
||||||
{"getName", ( PyCFunction ) Ipo_getName, METH_NOARGS,
|
{"getName", ( PyCFunction ) Ipo_getName, METH_NOARGS,
|
||||||
"() - Return Ipo Data name"},
|
"() - Return Ipo Data name"},
|
||||||
{"setName", ( PyCFunction ) Ipo_setName, METH_VARARGS,
|
{"setName", ( PyCFunction ) Ipo_oldsetName, METH_VARARGS,
|
||||||
"(str) - Change Ipo Data name"},
|
"(str) - Change Ipo Data name"},
|
||||||
{"getBlocktype", ( PyCFunction ) Ipo_getBlocktype, METH_NOARGS,
|
{"getBlocktype", ( PyCFunction ) Ipo_getBlocktype, METH_NOARGS,
|
||||||
"() - Return Ipo blocktype"},
|
"() - Return Ipo blocktype"},
|
||||||
{"setBlocktype", ( PyCFunction ) Ipo_setBlocktype, METH_VARARGS,
|
{"setBlocktype", ( PyCFunction ) Ipo_oldsetBlocktype, METH_VARARGS,
|
||||||
"(str) - Change Ipo blocktype"},
|
"(str) - Change Ipo blocktype"},
|
||||||
{"getRctf", ( PyCFunction ) Ipo_getRctf, METH_NOARGS,
|
{"getRctf", ( PyCFunction ) Ipo_getRctf, METH_NOARGS,
|
||||||
"() - Return Ipo rctf"},
|
"() - Return Ipo rctf"},
|
||||||
@@ -813,20 +815,21 @@ static PyObject *Ipo_getName( BPy_Ipo * self )
|
|||||||
"couldn't get Ipo.name attribute" );
|
"couldn't get Ipo.name attribute" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Ipo_setName( BPy_Ipo * self, PyObject * args )
|
static int Ipo_setName( BPy_Ipo * self, PyObject * args )
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
char buf[21];
|
char buf[21];
|
||||||
|
|
||||||
if( !PyArg_ParseTuple( args, "s", &name ) )
|
name = PyString_AsString( args );
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
if( !name )
|
||||||
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
"expected string argument" );
|
"expected string argument" );
|
||||||
|
|
||||||
PyOS_snprintf( buf, sizeof( buf ), "%s", name );
|
PyOS_snprintf( buf, sizeof( buf ), "%s", name );
|
||||||
|
|
||||||
rename_id( &self->ipo->id, buf );
|
rename_id( &self->ipo->id, buf );
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Ipo_getBlocktype( BPy_Ipo * self )
|
static PyObject *Ipo_getBlocktype( BPy_Ipo * self )
|
||||||
@@ -840,17 +843,15 @@ static PyObject *Ipo_getBlocktype( BPy_Ipo * self )
|
|||||||
"couldn't get Ipo.blocktype attribute" );
|
"couldn't get Ipo.blocktype attribute" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Ipo_setBlocktype( BPy_Ipo * self, PyObject * args )
|
static int Ipo_setBlocktype( BPy_Ipo * self, PyObject * args )
|
||||||
{
|
{
|
||||||
short blocktype = 0;
|
if( !PyInt_CheckExact( args ) )
|
||||||
|
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||||
if( !PyArg_ParseTuple( args, "h", &blocktype ) )
|
|
||||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
|
||||||
"expected int argument" );
|
"expected int argument" );
|
||||||
|
|
||||||
self->ipo->blocktype = blocktype;
|
self->ipo->blocktype = (short)PyInt_AS_LONG( args );
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *Ipo_getRctf( BPy_Ipo * self )
|
static PyObject *Ipo_getRctf( BPy_Ipo * self )
|
||||||
@@ -1851,3 +1852,15 @@ static PyObject *Ipo_oldsetRctf( BPy_Ipo * self, PyObject * args )
|
|||||||
return EXPP_setterWrapperTuple( (void *)self, args,
|
return EXPP_setterWrapperTuple( (void *)self, args,
|
||||||
(setter)Ipo_setRctf );
|
(setter)Ipo_setRctf );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *Ipo_oldsetName( BPy_Ipo * self, PyObject * args )
|
||||||
|
{
|
||||||
|
return EXPP_setterWrapperTuple( (void *)self, args,
|
||||||
|
(setter)Ipo_setName );
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *Ipo_oldsetBlocktype( BPy_Ipo * self, PyObject * args )
|
||||||
|
{
|
||||||
|
return EXPP_setterWrapperTuple( (void *)self, args,
|
||||||
|
(setter)Ipo_setBlocktype );
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user