summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/glibext/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/glibext/module.c')
-rw-r--r--plugins/pychrysalide/glibext/module.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/plugins/pychrysalide/glibext/module.c b/plugins/pychrysalide/glibext/module.c
index a3b0a25..45c92e8 100644
--- a/plugins/pychrysalide/glibext/module.c
+++ b/plugins/pychrysalide/glibext/module.c
@@ -33,27 +33,26 @@
#include "configuration.h"
#include "linegen.h"
#include "loadedpanel.h"
-#include "../access.h"
+#include "../helpers.h"
/******************************************************************************
* *
-* Paramètres : module = module dont la définition est à compléter. *
+* Paramètres : super = module dont la définition est à compléter. *
* *
-* Description : Ajoute le module 'glibext' au module Python. *
+* Description : Ajoute le module 'glibext' à un module Python. *
* *
-* Retour : - *
+* Retour : Bilan de l'opération. *
* *
* Remarques : - *
* *
******************************************************************************/
-bool add_glibext_module_to_python_module(PyObject *super)
+bool add_glibext_module(PyObject *super)
{
bool result; /* Bilan à retourner */
PyObject *module; /* Sous-module mis en place */
- int ret; /* Bilan d'un appel */
static PyModuleDef py_chrysalide_glibext_module = {
@@ -66,35 +65,40 @@ bool add_glibext_module_to_python_module(PyObject *super)
};
- result = false;
+ module = build_python_module(super, &py_chrysalide_glibext_module);
- module = PyModule_Create(&py_chrysalide_glibext_module);
- if (module == NULL) return false;
+ result = (module != NULL);
- ret = PyState_AddModule(super, &py_chrysalide_glibext_module);
- if (ret != 0) goto agmtpm_exit;
+ return result;
- ret = _PyImport_FixupBuiltin(module, "pychrysalide.glibext");
- if (ret != 0) goto agmtpm_exit;
+}
- Py_INCREF(module);
- ret = PyModule_AddObject(super, "glibext", module);
- if (ret != 0) goto agmtpm_exit;
- result = true;
+/******************************************************************************
+* *
+* Paramètres : - *
+* *
+* Description : Intègre les objets du module 'glibext'. *
+* *
+* Retour : Bilan de l'opération. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
- result &= register_python_buffer_cache(module);
- result &= register_python_buffer_line(module);
- result &= register_python_config_param(module);
- result &= register_python_config_param_iterator(module);
- result &= register_python_generic_config(module);
- result &= register_python_line_generator(module);
- result &= register_python_loaded_panel(module);
+bool populate_glibext_module(void)
+{
+ bool result; /* Bilan à retourner */
- if (result)
- register_access_to_python_module("pychrysalide.glibext", module);
+ result = true;
- agmtpm_exit:
+ if (result) result = ensure_python_buffer_cache_is_registered();
+ if (result) result = ensure_python_buffer_line_is_registered();
+ if (result) result = ensure_python_config_param_is_registered();
+ if (result) result = ensure_python_config_param_iterator_is_registered();
+ if (result) result = ensure_python_generic_config_is_registered();
+ if (result) result = ensure_python_line_generator_is_registered();
+ if (result) result = ensure_python_loaded_panel_is_registered();
assert(result);