summaryrefslogtreecommitdiff
path: root/src/plugins/scripts
diff options
context:
space:
mode:
authorEmmanuel Bouthenot <kolter@openics.org>2005-10-30 23:39:54 +0000
committerEmmanuel Bouthenot <kolter@openics.org>2005-10-30 23:39:54 +0000
commite6a1bb4694c2819da1c299826976fc7a9c7058fe (patch)
treed52ba15a5ad03670caab2257df4fb6e60396ea48 /src/plugins/scripts
parent6b6def589072d0de669b096c802435c08b7f870b (diff)
downloadweechat-e6a1bb4694c2819da1c299826976fc7a9c7058fe.zip
add constants for python return codes
Diffstat (limited to 'src/plugins/scripts')
-rw-r--r--src/plugins/scripts/python/weechat-python.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c
index cd947cd5a..cd8676f13 100644
--- a/src/plugins/scripts/python/weechat-python.c
+++ b/src/plugins/scripts/python/weechat-python.c
@@ -780,7 +780,7 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
{
FILE *fp;
PyThreadState *python_current_interpreter;
- PyObject *weechat_module, *weechat_outputs;
+ PyObject *weechat_module, *weechat_outputs, *weechat_dict;
plugin->printf_server (plugin, "Loading Python script \"%s\"", filename);
@@ -825,6 +825,14 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
return 0;
}
+ /* define some constants */
+ weechat_dict = PyModule_GetDict(weechat_module);
+ PyDict_SetItemString(weechat_dict, "PLUGIN_RC_OK", PyInt_FromLong((long) PLUGIN_RC_OK));
+ PyDict_SetItemString(weechat_dict, "PLUGIN_RC_KO", PyInt_FromLong((long) PLUGIN_RC_KO));
+ PyDict_SetItemString(weechat_dict, "PLUGIN_RC_OK_IGNORE_WEECHAT", PyInt_FromLong((long) PLUGIN_RC_OK_IGNORE_WEECHAT));
+ PyDict_SetItemString(weechat_dict, "PLUGIN_RC_OK_IGNORE_PLUGINS", PyInt_FromLong((long) PLUGIN_RC_OK_IGNORE_PLUGINS));
+ PyDict_SetItemString(weechat_dict, "PLUGIN_RC_OK_IGNORE_ALL", PyInt_FromLong((long) PLUGIN_RC_OK_IGNORE_ALL));
+
weechat_outputs = Py_InitModule("weechatOutputs", weechat_python_output_funcs);
if (weechat_outputs == NULL)
{