diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2021-02-07 20:30:07 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2021-02-07 20:30:07 (GMT) |
commit | 42540e681161aab0a1c27c66541ed5dc833ca411 (patch) | |
tree | a7a1329435252b7b1ac8981b6ab3a3abddcfe457 /plugins/pychrysalide/core.c | |
parent | 7c17177918f1bb94be7c84ca9b839155623ff05f (diff) |
Created the right place for plugins in the Python API.
Diffstat (limited to 'plugins/pychrysalide/core.c')
-rw-r--r-- | plugins/pychrysalide/core.c | 55 |
1 files changed, 4 insertions, 51 deletions
diff --git a/plugins/pychrysalide/core.c b/plugins/pychrysalide/core.c index 7bc46e4..30d4259 100644 --- a/plugins/pychrysalide/core.c +++ b/plugins/pychrysalide/core.c @@ -49,7 +49,6 @@ #include "access.h" #include "helpers.h" -#include "plugin.h" #include "star.h" #include "strenum.h" #include "struct.h" @@ -63,6 +62,8 @@ #include "gtkext/module.h" #include "gui/module.h" #include "mangling/module.h" +#include "plugins/module.h" +#include "plugins/plugin.h" @@ -100,9 +101,6 @@ static bool set_version_for_gtk_namespace(const char *); /* Point de sortie pour l'initialisation de Python. */ static void PyExit_pychrysalide(void); -/* Ajoute le module 'plugins' au module Python. */ -static bool add_plugin_module_to_python_module(PyObject *); - /* Complète les chemins de recherches de Python. */ static void extend_python_path(const char *); @@ -371,50 +369,6 @@ static void PyExit_pychrysalide(void) /****************************************************************************** * * -* Paramètres : super = module dont la définition est à compléter. * -* * -* Description : Ajoute le module 'plugins' au module Python. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static bool add_plugin_module_to_python_module(PyObject *super) -{ - bool result; /* Bilan à retourner */ - PyObject *module; /* Sous-module mis en place */ - -#define PYCHRYSALIDE_PLUGINS_DOC \ - "Home for all plugins without another home." - - static PyModuleDef py_chrysalide_deguard_module = { - - .m_base = PyModuleDef_HEAD_INIT, - - .m_name = "pychrysalide.plugins", - .m_doc = PYCHRYSALIDE_PLUGINS_DOC, - - .m_size = -1, - - }; - - result = false; - - module = build_python_module(super, &py_chrysalide_deguard_module); - - result = (module != NULL); - - assert(result); - - return result; - -} - - -/****************************************************************************** -* * * Paramètres : - * * * * Description : Point d'entrée pour l'initialisation de Python. * @@ -514,8 +468,6 @@ PyMODINIT_FUNC PyInit_pychrysalide(void) if (status) status = add_features_module(result); - if (status) add_plugin_module_to_python_module(result); - if (status) status = add_analysis_module(result); if (status) status = add_arch_module(result); if (status) status = add_common_module(result); @@ -526,8 +478,8 @@ PyMODINIT_FUNC PyInit_pychrysalide(void) if (status) status = add_gtkext_module(result); if (status) status = add_gui_module(result); if (status) status = add_mangling_module(result); + if (status) status = add_plugins_module(result); - if (status) status = ensure_python_plugin_module_is_registered(); if (status) status = ensure_python_string_enum_is_registered(); if (status) status = ensure_python_py_struct_is_registered(); @@ -541,6 +493,7 @@ PyMODINIT_FUNC PyInit_pychrysalide(void) if (status) status = populate_gtkext_module(); if (status) status = populate_gui_module(); if (status) status = populate_mangling_module(); + if (status) status = populate_plugins_module(); if (!status) { |