diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-06-17 16:01:09 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-06-17 16:01:09 +0200 |
commit | af87798455e9d82773094a3c274ecb991af41ed9 (patch) | |
tree | 32de00c475b9f127003d6e663d6e8f98f13ad3ad /src/plugins/scripts/python | |
parent | 860842240b2c3f673a2265716359cb6605048386 (diff) | |
download | weechat-af87798455e9d82773094a3c274ecb991af41ed9.zip |
New plugin "notify", new option for debug messages in plugins
Diffstat (limited to 'src/plugins/scripts/python')
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index f6467e6c3..605c8d219 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -2987,6 +2987,39 @@ weechat_python_api_buffer_close (PyObject *self, PyObject *args) } /* + * weechat_python_api_buffer_get_integer get a buffer property as integer + */ + +static PyObject * +weechat_python_api_buffer_get_integer (PyObject *self, PyObject *args) +{ + char *buffer, *property; + int value; + + /* make C compiler happy */ + (void) self; + + if (!python_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("buffer_get_integer"); + PYTHON_RETURN_INT(-1); + } + + buffer = NULL; + property = NULL; + + if (!PyArg_ParseTuple (args, "ss", &buffer, &property)) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_get_integer"); + PYTHON_RETURN_INT(-1); + } + + value = weechat_buffer_get_integer (script_str2ptr (buffer), property); + + PYTHON_RETURN_INT(value); +} + +/* * weechat_python_api_buffer_get_string: get a buffer property as string */ @@ -4144,6 +4177,7 @@ PyMethodDef weechat_python_funcs[] = { "buffer_search", &weechat_python_api_buffer_search, METH_VARARGS, "" }, { "buffer_clear", &weechat_python_api_buffer_clear, METH_VARARGS, "" }, { "buffer_close", &weechat_python_api_buffer_close, METH_VARARGS, "" }, + { "buffer_get_integer", &weechat_python_api_buffer_get_integer, METH_VARARGS, "" }, { "buffer_get_string", &weechat_python_api_buffer_get_string, METH_VARARGS, "" }, { "buffer_get_pointer", &weechat_python_api_buffer_get_pointer, METH_VARARGS, "" }, { "buffer_set", &weechat_python_api_buffer_set, METH_VARARGS, "" }, |