diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-12-18 18:09:12 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-12-18 18:09:12 +0100 |
commit | 58df8c2d83ce3ea4b22b48d3a801170066bb801f (patch) | |
tree | 35a85129cec206d5f15bdd514b36edc7aed58fd7 /src/plugins/scripts/python | |
parent | 846fb5d28342f338a9586089b3d6609a5d791549 (diff) | |
download | weechat-58df8c2d83ce3ea4b22b48d3a801170066bb801f.zip |
Add function "infolist_new_item" in script API
Diffstat (limited to 'src/plugins/scripts/python')
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index c13e9cb18..35782cd63 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -5353,6 +5353,38 @@ weechat_python_api_infolist_new (PyObject *self, PyObject *args) } /* + * weechat_python_api_infolist_new_item: create new item in infolist + */ + +static PyObject * +weechat_python_api_infolist_new_item (PyObject *self, PyObject *args) +{ + char *infolist, *result; + PyObject *object; + + /* make C compiler happy */ + (void) self; + + if (!python_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "infolist_new_item"); + PYTHON_RETURN_EMPTY; + } + + infolist = NULL; + + if (!PyArg_ParseTuple (args, "s", &infolist)) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGS(PYTHON_CURRENT_SCRIPT_NAME, "infolist_new_item"); + PYTHON_RETURN_EMPTY; + } + + result = script_ptr2str (weechat_infolist_new_item (script_str2ptr (infolist))); + + PYTHON_RETURN_STRING_FREE(result); +} + +/* * weechat_python_api_infolist_new_var_integer: create new integer variable in * infolist */ @@ -6118,6 +6150,7 @@ PyMethodDef weechat_python_funcs[] = { "command", &weechat_python_api_command, METH_VARARGS, "" }, { "info_get", &weechat_python_api_info_get, METH_VARARGS, "" }, { "infolist_new", &weechat_python_api_infolist_new, METH_VARARGS, "" }, + { "infolist_new_item", &weechat_python_api_infolist_new_item, METH_VARARGS, "" }, { "infolist_new_var_integer", &weechat_python_api_infolist_new_var_integer, METH_VARARGS, "" }, { "infolist_new_var_string", &weechat_python_api_infolist_new_var_string, METH_VARARGS, "" }, { "infolist_new_var_pointer", &weechat_python_api_infolist_new_var_pointer, METH_VARARGS, "" }, |