talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit de6f18826fe06f2592e2436b70a340cb20241df0
parent f793a3ae68b75afdc9c866480e3e45dc92b567e2
Author: Holger Berndt <hb@claws-mail.org>
Date:   Sun, 15 Mar 2015 21:24:29 +0100

Python plugin: Silence parasite glib warnings

Diffstat:
Msrc/plugins/python/python_plugin.c | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/plugins/python/python_plugin.c b/src/plugins/python/python_plugin.c @@ -637,9 +637,14 @@ done: return retval ? retval : g_strdup("Unspecified error occured"); } +static void log_func(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) +{ +} gint plugin_init(gchar **error) { + guint log_handler; + int parasite_retval; PyObject *inst_StringIO = NULL; /* Version check */ @@ -678,7 +683,10 @@ gint plugin_init(gchar **error) } /* initialize python interactive shell */ - if(!parasite_python_init(error)) { + log_handler = g_log_set_handler(NULL, G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO, log_func, NULL); + parasite_retval = parasite_python_init(error); + g_log_remove_handler(NULL, log_handler); + if(!parasite_retval) { goto err; }