diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-05-06 16:51:30 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-05-06 16:51:30 +0200 |
commit | e9603acb1a1943bda3c2cc809e5e39ff8a13b68c (patch) | |
tree | d4fb7fef63f5a4c1d415fdca9c1938016b23bbb3 /src/plugins/scripts/python/weechat-python-api.c | |
parent | e7a16efa0cf5123f87ef6d7072fbbb9ccdd42bac (diff) | |
download | weechat-e9603acb1a1943bda3c2cc809e5e39ff8a13b68c.zip |
IRC DCC chat and file (without resume) reintroduced, via xfer plugin (called by /dcc command)
Diffstat (limited to 'src/plugins/scripts/python/weechat-python-api.c')
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 9a7696c24..c1ea8821d 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -2919,6 +2919,37 @@ weechat_python_api_buffer_search (PyObject *self, PyObject *args) } /* + * weechat_python_api_buffer_clear: clear a buffer + */ + +static PyObject * +weechat_python_api_buffer_clear (PyObject *self, PyObject *args) +{ + char *buffer; + + /* make C compiler happy */ + (void) self; + + if (!python_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("buffer_clear"); + PYTHON_RETURN_ERROR; + } + + buffer = NULL; + + if (!PyArg_ParseTuple (args, "s", &buffer)) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_clear"); + PYTHON_RETURN_ERROR; + } + + weechat_buffer_clear (script_str2ptr (buffer)); + + PYTHON_RETURN_OK; +} + +/* * weechat_python_api_buffer_close: close a buffer */ @@ -4110,6 +4141,7 @@ PyMethodDef weechat_python_funcs[] = { "unhook_all", &weechat_python_api_unhook_all, METH_VARARGS, "" }, { "buffer_new", &weechat_python_api_buffer_new, METH_VARARGS, "" }, { "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_string", &weechat_python_api_buffer_get_string, METH_VARARGS, "" }, { "buffer_get_pointer", &weechat_python_api_buffer_get_pointer, METH_VARARGS, "" }, |