780 |
{ |
{ |
781 |
FILE *fp; |
FILE *fp; |
782 |
PyThreadState *python_current_interpreter; |
PyThreadState *python_current_interpreter; |
783 |
PyObject *weechat_module, *weechat_outputs; |
PyObject *weechat_module, *weechat_outputs, *weechat_dict; |
784 |
|
|
785 |
plugin->printf_server (plugin, "Loading Python script \"%s\"", filename); |
plugin->printf_server (plugin, "Loading Python script \"%s\"", filename); |
786 |
|
|
825 |
return 0; |
return 0; |
826 |
} |
} |
827 |
|
|
828 |
|
/* define some constants */ |
829 |
|
weechat_dict = PyModule_GetDict(weechat_module); |
830 |
|
PyDict_SetItemString(weechat_dict, "PLUGIN_RC_OK", PyInt_FromLong((long) PLUGIN_RC_OK)); |
831 |
|
PyDict_SetItemString(weechat_dict, "PLUGIN_RC_KO", PyInt_FromLong((long) PLUGIN_RC_KO)); |
832 |
|
PyDict_SetItemString(weechat_dict, "PLUGIN_RC_OK_IGNORE_WEECHAT", PyInt_FromLong((long) PLUGIN_RC_OK_IGNORE_WEECHAT)); |
833 |
|
PyDict_SetItemString(weechat_dict, "PLUGIN_RC_OK_IGNORE_PLUGINS", PyInt_FromLong((long) PLUGIN_RC_OK_IGNORE_PLUGINS)); |
834 |
|
PyDict_SetItemString(weechat_dict, "PLUGIN_RC_OK_IGNORE_ALL", PyInt_FromLong((long) PLUGIN_RC_OK_IGNORE_ALL)); |
835 |
|
|
836 |
weechat_outputs = Py_InitModule("weechatOutputs", weechat_python_output_funcs); |
weechat_outputs = Py_InitModule("weechatOutputs", weechat_python_output_funcs); |
837 |
if (weechat_outputs == NULL) |
if (weechat_outputs == NULL) |
838 |
{ |
{ |