diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-12-07 14:43:08 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-12-07 14:43:08 (GMT) |
commit | 48ac5e6e8fe50c1ff4b9e77440a6365f8b01021f (patch) | |
tree | 14802b7a73329921a928017d721dd842272ffbe2 | |
parent | 2c988d3ec52cc4c949a35aca7ef335dac773df92 (diff) |
Synchronised the Python bindings: made routines inherit from symbols.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/routine.c | 4 | ||||
-rw-r--r-- | plugins/pychrysa/format/symbol.c | 2 | ||||
-rw-r--r-- | plugins/pychrysa/pychrysa.c | 4 |
4 files changed, 14 insertions, 3 deletions
@@ -1,3 +1,10 @@ +17-12-07 Cyrille Bagard <nocbos@gmail.com> + + * plugins/pychrysa/analysis/routine.c: + * plugins/pychrysa/format/symbol.c: + * plugins/pychrysa/pychrysa.c: + Synchronise the Python bindings: make routines inherit from symbols. + 17-12-02 Cyrille Bagard <nocbos@gmail.com> * .gitignore: diff --git a/plugins/pychrysa/analysis/routine.c b/plugins/pychrysa/analysis/routine.c index 98be3a2..1151b96 100644 --- a/plugins/pychrysa/analysis/routine.c +++ b/plugins/pychrysa/analysis/routine.c @@ -38,6 +38,7 @@ #include "block.h" #include "../helpers.h" +#include "../format/symbol.h" @@ -285,7 +286,8 @@ bool register_python_binary_routine(PyObject *module) dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BIN_ROUTINE, py_binary_routine_type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BIN_ROUTINE, + py_binary_routine_type, get_python_binary_symbol_type())) return false; return true; diff --git a/plugins/pychrysa/format/symbol.c b/plugins/pychrysa/format/symbol.c index e337ea1..b9ac13c 100644 --- a/plugins/pychrysa/format/symbol.c +++ b/plugins/pychrysa/format/symbol.c @@ -361,7 +361,7 @@ PyTypeObject *get_python_binary_symbol_type(void) .tp_name = "pychrysalide.format.BinSymbol", .tp_basicsize = sizeof(PyGObject), - .tp_flags = Py_TPFLAGS_DEFAULT, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_doc = "PyChrysalide binary symbol", diff --git a/plugins/pychrysa/pychrysa.c b/plugins/pychrysa/pychrysa.c index c971e56..7629132 100644 --- a/plugins/pychrysa/pychrysa.c +++ b/plugins/pychrysa/pychrysa.c @@ -389,13 +389,15 @@ PyMODINIT_FUNC PyInit_pychrysalide(void) /* Interface 'LineGenerator' en premier... */ status = add_glibext_module_to_python_module(result); + /* BinRoutine hérite de BinSymbol... */ + if (status) status = add_format_module_to_python_module(result); + if (status) status = register_python_plugin_module(result); if (status) status = add_analysis_module_to_python_module(result); if (status) status = add_arch_module_to_python_module(result); if (status) status = add_common_module_to_python_module(result); if (status) status = add_core_module_to_python_module(result); if (status) status = add_debug_module_to_python_module(result); - if (status) status = add_format_module_to_python_module(result); if (status) status = add_gtkext_module_to_python_module(result); if (status) status = add_gui_module_to_python_module(result); |