diff options
Diffstat (limited to 'plugins/pychrysa/format/executable.c')
-rw-r--r-- | plugins/pychrysa/format/executable.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/plugins/pychrysa/format/executable.c b/plugins/pychrysa/format/executable.c index e7e218d..c48ae2f 100644 --- a/plugins/pychrysa/format/executable.c +++ b/plugins/pychrysa/format/executable.c @@ -32,6 +32,7 @@ #include "format.h" +#include "../helpers.h" @@ -93,25 +94,15 @@ PyTypeObject *get_python_executable_format_type(void) bool register_python_executable_format(PyObject *module) { PyTypeObject *py_exe_format_type; /* Type Python 'ExeFormat' */ - int ret; /* Bilan d'un appel */ PyObject *dict; /* Dictionnaire du module */ py_exe_format_type = get_python_executable_format_type(); - py_exe_format_type->tp_base = get_python_binary_format_type(); - py_exe_format_type->tp_basicsize = py_exe_format_type->tp_base->tp_basicsize; + dict = PyModule_GetDict(module); - if (PyType_Ready(py_exe_format_type) != 0) + if (!register_class_for_pygobject(dict, G_TYPE_EXE_FORMAT, py_exe_format_type, get_python_binary_format_type())) return false; - Py_INCREF(py_exe_format_type); - ret = PyModule_AddObject(module, "ExeFormat", (PyObject *)py_exe_format_type); - if (ret != 0) return false; - - dict = PyModule_GetDict(module); - pygobject_register_class(dict, "ExeFormat", G_TYPE_EXE_FORMAT, py_exe_format_type, - Py_BuildValue("(O)", py_exe_format_type->tp_base)); - return true; } |