Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-06-16 16:24:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-06-16 16:24:41 +0400
commit39a526a963e9e0a0f206556a8b740fab56ba2654 (patch)
tree69290c8f2186c5dbc4673da0a6de60a874e18ab2 /source/blender/python/api2_2x/Text3d.c
parent5135ed7b0e5c09c77a54e4359d7ff0b92003f4f0 (diff)
Python PyMethodDef supports single argument methods (METH_O) but was using METH_VARARGS everywhere and getting the single args from the tuple.
Use METH_O where applicable.
Diffstat (limited to 'source/blender/python/api2_2x/Text3d.c')
-rw-r--r--source/blender/python/api2_2x/Text3d.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c
index 4e860113ac8..695f84728c7 100644
--- a/source/blender/python/api2_2x/Text3d.c
+++ b/source/blender/python/api2_2x/Text3d.c
@@ -83,7 +83,7 @@ static PyObject *generate_ModuleIntConstant(char *name, int value);
struct PyMethodDef M_Text3d_methods[] = {
{"New", ( PyCFunction ) M_Text3d_New, METH_VARARGS, NULL},
{"Get", ( PyCFunction ) M_Text3d_Get, METH_VARARGS, NULL},
- {"LoadFont", ( PyCFunction ) M_Text3d_LoadFont, METH_VARARGS, NULL},
+ {"LoadFont", ( PyCFunction ) M_Text3d_LoadFont, METH_O, NULL},
{NULL, NULL, 0, NULL}
};
@@ -1173,13 +1173,13 @@ static PyObject *Text3d_removeFrame( BPy_Text3d * self, PyObject * args )
}
-PyObject *M_Text3d_LoadFont( PyObject * self, PyObject * args )
+PyObject *M_Text3d_LoadFont( PyObject * self, PyObject * value )
{
- char *fontfile= NULL;
+ char *fontfile= PyString_AsString(value);
FILE *file= NULL;
VFont *vf= NULL;
- if( !PyArg_ParseTuple( args, "s", &fontfile ) )
+ if( !fontfile )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected a string" );
vf= exist_vfont(fontfile);