From 3fd2af81847440fa221621572d6cf36eca910483 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 26 Apr 2011 17:47:49 +0200 Subject: api: add new function config_set_desc_plugin (task #10925) --- src/plugins/scripts/python/weechat-python-api.c | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/plugins/scripts/python/weechat-python-api.c') diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 9a3924fc4..daf7d8b75 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -2759,6 +2759,41 @@ weechat_python_api_config_set_plugin (PyObject *self, PyObject *args) PYTHON_RETURN_INT(rc); } +/* + * weechat_python_api_config_set_desc_plugin: set description of a plugin option + */ + +static PyObject * +weechat_python_api_config_set_desc_plugin (PyObject *self, PyObject *args) +{ + char *option, *description; + + /* make C compiler happy */ + (void) self; + + if (!python_current_script || !python_current_script->name) + { + WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "config_set_desc_plugin"); + PYTHON_RETURN_ERROR; + } + + option = NULL; + description = NULL; + + if (!PyArg_ParseTuple (args, "ss", &option, &description)) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGS(PYTHON_CURRENT_SCRIPT_NAME, "config_set_desc_plugin"); + PYTHON_RETURN_ERROR; + } + + script_api_config_set_desc_plugin (weechat_python_plugin, + python_current_script, + option, + description); + + PYTHON_RETURN_OK; +} + /* * weechat_python_api_config_unset_plugin: unset plugin option */ @@ -7066,6 +7101,7 @@ PyMethodDef weechat_python_funcs[] = { "config_get_plugin", &weechat_python_api_config_get_plugin, METH_VARARGS, "" }, { "config_is_set_plugin", &weechat_python_api_config_is_set_plugin, METH_VARARGS, "" }, { "config_set_plugin", &weechat_python_api_config_set_plugin, METH_VARARGS, "" }, + { "config_set_desc_plugin", &weechat_python_api_config_set_desc_plugin, METH_VARARGS, "" }, { "config_unset_plugin", &weechat_python_api_config_unset_plugin, METH_VARARGS, "" }, { "prefix", &weechat_python_api_prefix, METH_VARARGS, "" }, { "color", &weechat_python_api_color, METH_VARARGS, "" }, -- cgit v1.2.3