diff options
Diffstat (limited to 'plugins/pychrysalide/core.c')
-rw-r--r-- | plugins/pychrysalide/core.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/plugins/pychrysalide/core.c b/plugins/pychrysalide/core.c index ee88521..a148654 100644 --- a/plugins/pychrysalide/core.c +++ b/plugins/pychrysalide/core.c @@ -665,6 +665,8 @@ static void load_python_plugins(GPluginModule *plugin) char *modname; /* Nom du module pour Python */ char *filename; /* Chemin d'accès reconstruit */ GPluginModule *pyplugin; /* Lien vers un grffon Python */ + bool status; /* Bilan d'une opération */ + GGenConfig *config; /* Configuration à charger */ /* Définition des zones d'influence */ @@ -744,25 +746,42 @@ static void load_python_plugins(GPluginModule *plugin) pyplugin = g_python_plugin_new(modname, filename); if (pyplugin == NULL) + { g_plugin_module_log_variadic_message(plugin, LMT_ERROR, _("No suitable Python plugin found in '%s'"), filename); - else - { - g_plugin_module_log_variadic_message(plugin, LMT_PROCESS, - _("Loaded the Python plugin found in the '<b>%s</b>' directory"), - filename); + goto done_with_plugin; + } - /** - * Comme le greffon n'est pas passé par la résolution des dépendances, - * on simule l'effet attendu. - */ - g_object_ref(G_OBJECT(plugin)); + g_plugin_module_create_config(pyplugin); - _register_plugin(pyplugin); + status = g_plugin_module_manage(pyplugin, PGA_PLUGIN_LOADED); + if (!status) + { + g_plugin_module_log_variadic_message(plugin, LMT_ERROR, + _("Plugin '%s' failed to complete loading..."), filename); + goto done_with_plugin; } + config = g_plugin_module_get_config(pyplugin); + g_generic_config_read(config); + g_object_unref(G_OBJECT(config)); + + g_plugin_module_log_variadic_message(plugin, LMT_PROCESS, + _("Loaded the Python plugin found in the '<b>%s</b>' directory"), + filename); + + /** + * Comme le greffon n'est pas passé par la résolution des dépendances, + * on simule l'effet attendu. + */ + g_object_ref(G_OBJECT(plugin)); + + _register_plugin(pyplugin); + + done_with_plugin: + free(filename); free(modname); |