plugins: python-renderer: Implement first gds_render built-in module with a get_number function

This commit is contained in:
2019-11-17 15:42:17 +01:00
parent 71b500e030
commit aa7f5b4745
3 changed files with 41 additions and 0 deletions

View File

@@ -24,3 +24,30 @@
*/
#include <python-renderer/gds-render-module.h>
static PyObject *test(PyObject *self, PyObject *args)
{
if(!PyArg_ParseTuple(args, ":numargs"))
return NULL;
return PyLong_FromLong(20UL);
}
static PyMethodDef gds_render_methods[] = {
{"get_number", test, METH_VARARGS,
"Return the number of arguments received by the process."},
{NULL, NULL, 0, NULL}
};
static PyModuleDef gds_render_module = {
PyModuleDef_HEAD_INIT, "gds_render", NULL, -1, gds_render_methods,
NULL, NULL, NULL, NULL
};
PyObject *init_gds_render_module(void)
{
PyObject *this_module;
this_module = PyModule_Create(&gds_render_module);
return this_module;
}