diff options
Diffstat (limited to 'plugins/pychrysalide/analysis/variable.c')
-rw-r--r-- | plugins/pychrysalide/analysis/variable.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/plugins/pychrysalide/analysis/variable.c b/plugins/pychrysalide/analysis/variable.c index 268e3c9..030b26f 100644 --- a/plugins/pychrysalide/analysis/variable.c +++ b/plugins/pychrysalide/analysis/variable.c @@ -35,6 +35,7 @@ #include <analysis/variable.h> +#include "../access.h" #include "../helpers.h" @@ -241,7 +242,7 @@ PyTypeObject *get_python_binary_variable_type(void) /****************************************************************************** * * -* Paramètres : module = module dont la définition est à compléter. * +* Paramètres : - * * * * Description : Prend en charge l'objet 'pychrysalide.analysis.BinVariable'. * * * @@ -251,17 +252,24 @@ PyTypeObject *get_python_binary_variable_type(void) * * ******************************************************************************/ -bool register_python_binary_variable(PyObject *module) +bool ensure_python_binary_variable_is_registered(void) { - PyTypeObject *py_binary_variable_type; /* Type Python 'BinVariable' */ + PyTypeObject *type; /* Type Python 'ProxyFeeder' */ + PyObject *module; /* Module à recompléter */ PyObject *dict; /* Dictionnaire du module */ - py_binary_variable_type = get_python_binary_variable_type(); + type = get_python_binary_variable_type(); + + if (!PyType_HasFeature(type, Py_TPFLAGS_READY)) + { + module = get_access_to_python_module("pychrysalide.analysis"); - dict = PyModule_GetDict(module); + dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BIN_VARIABLE, py_binary_variable_type, &PyGObject_Type)) - return false; + if (!register_class_for_pygobject(dict, G_TYPE_BIN_VARIABLE, type, &PyGObject_Type)) + return false; + + } return true; |