summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/plugin.c')
-rw-r--r--plugins/pychrysa/plugin.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/plugins/pychrysa/plugin.c b/plugins/pychrysa/plugin.c
index 5e968e2..3703343 100644
--- a/plugins/pychrysa/plugin.c
+++ b/plugins/pychrysa/plugin.c
@@ -791,28 +791,18 @@ PyTypeObject *get_python_plugin_module_type(void)
bool register_python_plugin_module(PyObject *module)
{
PyTypeObject *py_plugin_module_type; /* Type Python 'PluginModule' */
- int ret; /* Bilan d'un appel */
PyObject *dict; /* Dictionnaire du module */
py_plugin_module_type = get_python_plugin_module_type();
- py_plugin_module_type->tp_base = &PyGObject_Type;
- py_plugin_module_type->tp_basicsize = py_plugin_module_type->tp_base->tp_basicsize;
+ dict = PyModule_GetDict(module);
- if (PyType_Ready(py_plugin_module_type) != 0)
+ if (!register_class_for_pygobject(dict, G_TYPE_PLUGIN_MODULE, py_plugin_module_type, &PyGObject_Type))
return false;
if (!py_plugin_module_define_constants(py_plugin_module_type))
return false;
- Py_INCREF(py_plugin_module_type);
- ret = PyModule_AddObject(module, "PluginModule", (PyObject *)py_plugin_module_type);
- if (ret != 0) return false;
-
- dict = PyModule_GetDict(module);
- pygobject_register_class(dict, "PluginModule", G_TYPE_PLUGIN_MODULE, py_plugin_module_type,
- Py_BuildValue("(O)", py_plugin_module_type->tp_base));
-
return true;
}