summaryrefslogtreecommitdiff
path: root/src/plugins/python
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-08-08 11:38:27 +0200
committerSebastien Helleu <flashcode@flashtux.org>2012-08-08 11:38:27 +0200
commit46bc18193397a8a3d5b756f1ffeda8c5f725d9b4 (patch)
tree8c934b370b6a1743d9e1d24cf6ddf5d9a3d0437e /src/plugins/python
parent068d0df56b299d0cc023309c1a6c3cd3fee30bde (diff)
downloadweechat-46bc18193397a8a3d5b756f1ffeda8c5f725d9b4.zip
scripts: add signals for scripts loaded/unloaded/installed/removed
Diffstat (limited to 'src/plugins/python')
-rw-r--r--src/plugins/python/weechat-python.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c
index ef19891d9..d237df29d 100644
--- a/src/plugins/python/weechat-python.c
+++ b/src/plugins/python/weechat-python.c
@@ -740,6 +740,9 @@ weechat_python_load (const char *filename)
&weechat_python_api_buffer_input_data_cb,
&weechat_python_api_buffer_close_cb);
+ weechat_hook_signal_send ("python_script_loaded", WEECHAT_HOOK_SIGNAL_STRING,
+ python_current_script->filename);
+
return 1;
}
@@ -766,6 +769,7 @@ weechat_python_unload (struct t_plugin_script *script)
int *rc;
void *interpreter;
PyThreadState *old_interpreter;
+ char *filename;
if ((weechat_python_plugin->debug >= 2) || !python_quiet)
{
@@ -782,6 +786,7 @@ weechat_python_unload (struct t_plugin_script *script)
free (rc);
}
+ filename = strdup (script->filename);
old_interpreter = PyThreadState_Swap (NULL);
interpreter = script->interpreter;
@@ -800,6 +805,11 @@ weechat_python_unload (struct t_plugin_script *script)
if (old_interpreter)
PyThreadState_Swap (old_interpreter);
+
+ weechat_hook_signal_send ("python_script_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, filename);
+ if (filename)
+ free (filename);
}
/*