diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-06-16 17:17:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-06-16 17:17:41 +0400 |
commit | 84749aa3ff39af08cdccfea462fb4a6a266ca7b8 (patch) | |
tree | 63954fcd3eb073fe8e057974f750c641b6d17bfd /source/blender/python/api2_2x/windowTheme.c | |
parent | 3e490c020324dcd4d7a3a3acd62f48d3fd781afc (diff) |
Python API, more METH_VARARGS to METH_O
Diffstat (limited to 'source/blender/python/api2_2x/windowTheme.c')
-rw-r--r-- | source/blender/python/api2_2x/windowTheme.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/api2_2x/windowTheme.c b/source/blender/python/api2_2x/windowTheme.c index 7ae7a0a32de..c8adec8e7a3 100644 --- a/source/blender/python/api2_2x/windowTheme.c +++ b/source/blender/python/api2_2x/windowTheme.c @@ -519,7 +519,7 @@ static PyObject *Theme_repr( BPy_Theme * self ); static PyObject *Theme_get( BPy_Theme * self, PyObject * args ); static PyObject *Theme_getName( BPy_Theme * self ); -static PyObject *Theme_setName( BPy_Theme * self, PyObject * args ); +static PyObject *Theme_setName( BPy_Theme * self, PyObject * value ); static PyMethodDef BPy_Theme_methods[] = { {"get", ( PyCFunction ) Theme_get, METH_VARARGS, @@ -530,7 +530,7 @@ static PyMethodDef BPy_Theme_methods[] = { - (s) - string: 'UI' or a space name, like 'VIEW3D', etc."}, {"getName", ( PyCFunction ) Theme_getName, METH_NOARGS, "() - Return Theme name"}, - {"setName", ( PyCFunction ) Theme_setName, METH_VARARGS, + {"setName", ( PyCFunction ) Theme_setName, METH_O, "(s) - Set Theme name"}, {NULL, NULL, 0, NULL} }; @@ -775,11 +775,11 @@ static PyObject *Theme_getName( BPy_Theme * self ) return PyString_FromString( self->theme->name ); } -static PyObject *Theme_setName( BPy_Theme * self, PyObject * args ) +static PyObject *Theme_setName( BPy_Theme * self, PyObject * value ) { - char *name = NULL; + char *name = PyString_AsString(value); - if( !PyArg_ParseTuple( args, "s", &name ) ) + if( !name ) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected string argument" ); |