summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/pychrysa.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/pychrysa.c')
-rw-r--r--plugins/pychrysalide/pychrysa.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/plugins/pychrysalide/pychrysa.c b/plugins/pychrysalide/pychrysa.c
index 8e37b09..683e41e 100644
--- a/plugins/pychrysalide/pychrysa.c
+++ b/plugins/pychrysalide/pychrysa.c
@@ -43,8 +43,7 @@
#include <common/extstr.h>
#include <core/core.h>
#include <plugins/pglist.h>
-#include <plugins/plugin-def.h>
-#include <plugins/plugin-int.h>
+#include <plugins/self.h>
#include "access.h"
@@ -66,15 +65,13 @@
-DEFINE_CHRYSALIDE_CONTAINER_PLUGIN("GPyChrysalidePlugin", "PyChrysalide", "Provides bindings to Python", "0.1.0",
- EMPTY_PG_LIST(.required), AL(PGA_PLUGIN_INIT, PGA_PLUGIN_EXIT, PGA_NATIVE_LOADED));
+DEFINE_CHRYSALIDE_CONTAINER_PLUGIN("PyChrysalide", "Chrysalide bindings to Python",
+ PACKAGE_VERSION, CHRYSALIDE_WEBSITE("api/python/pychrysalide"),
+ NO_REQ, AL(PGA_PLUGIN_INIT, PGA_PLUGIN_EXIT, PGA_NATIVE_LOADED));
-/* Conservation d'une référence au greffon pour les messages */
-static GPluginModule *_this = NULL;
-
/* Note la nature du chargement */
-#define _standalone (_this == NULL)
+static bool _standalone = true;
/* Réceptacle pour le chargement forcé */
static PyObject *_chrysalide_module = NULL;
@@ -777,7 +774,7 @@ G_MODULE_EXPORT bool chrysalide_plugin_init(GPluginModule *plugin)
bool result; /* Bilan à retourner */
int ret; /* Bilan de préparatifs */
- _this = plugin;
+ _standalone = false;
/* Chargement du module pour Python */
@@ -785,8 +782,7 @@ G_MODULE_EXPORT bool chrysalide_plugin_init(GPluginModule *plugin)
if (ret == -1)
{
- g_plugin_module_log_variadic_message(plugin, LMT_ERROR,
- _("Can not extend the existing table of Python built-in modules."));
+ log_plugin_simple_message(LMT_ERROR, _("Can not extend the existing table of Python built-in modules."));
result = false;
goto cpi_done;
}
@@ -900,29 +896,6 @@ PyThreadState *get_pychrysalide_main_tstate(void)
/******************************************************************************
* *
-* Paramètres : msg = message à faire apparaître à l'écran. *
-* *
-* Description : Présente dans le journal un message simple. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void log_pychrysalide_simple_message(LogMessageType type, const char *msg)
-{
- if (_this != NULL)
- g_plugin_module_log_simple_message(_this, type, msg);
-
- else
- log_simple_message(type, msg);
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : prefix = message d'introduction à faire apparaître à l'écran.*
* *
* Description : Présente dans le journal une exception survenue. *
@@ -976,7 +949,7 @@ void log_pychrysalide_exception(const char *prefix, ...)
Py_XDECREF(err_traceback);
Py_XDECREF(err_type);
- log_pychrysalide_simple_message(LMT_ERROR, msg);
+ log_plugin_simple_message(LMT_ERROR, msg);
free(msg);