diff options
Diffstat (limited to 'plugins/pychrysa/analysis/db/items')
-rw-r--r-- | plugins/pychrysa/analysis/db/items/comment.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/plugins/pychrysa/analysis/db/items/comment.c b/plugins/pychrysa/analysis/db/items/comment.c index ead5179..5ce54c9 100644 --- a/plugins/pychrysa/analysis/db/items/comment.c +++ b/plugins/pychrysa/analysis/db/items/comment.c @@ -33,6 +33,7 @@ #include "../item.h" +#include "../../../helpers.h" #include "../../../arch/vmpa.h" @@ -213,25 +214,15 @@ PyTypeObject *get_python_db_comment_type(void) bool register_python_db_comment(PyObject *module) { PyTypeObject *py_db_comment_type; /* Type Python 'DbComment' */ - int ret; /* Bilan d'un appel */ PyObject *dict; /* Dictionnaire du module */ py_db_comment_type = get_python_db_comment_type(); - py_db_comment_type->tp_base = get_python_db_item_type(); - py_db_comment_type->tp_basicsize = py_db_comment_type->tp_base->tp_basicsize; + dict = PyModule_GetDict(module); - if (PyType_Ready(py_db_comment_type) != 0) + if (!register_class_for_pygobject(dict, G_TYPE_DB_COMMENT, py_db_comment_type, get_python_db_item_type())) return false; - Py_INCREF(py_db_comment_type); - ret = PyModule_AddObject(module, "DbComment", (PyObject *)py_db_comment_type); - if (ret != 0) return false; - - dict = PyModule_GetDict(module); - pygobject_register_class(dict, "DbComment", G_TYPE_DB_COMMENT, py_db_comment_type, - Py_BuildValue("(O)", py_db_comment_type->tp_base)); - return true; } |