diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-03-28 18:57:10 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-03-28 18:57:10 +0100 |
commit | 868bc6b63deca8411cc111e6d2902e3f6741bc03 (patch) | |
tree | c902d2932c03ff548b336966011d6de180412554 /src/plugins/scripts/python/weechat-python-api.c | |
parent | 34a3c8637dd2aa90c9233fc620dd4c10c7dc7793 (diff) | |
download | weechat-868bc6b63deca8411cc111e6d2902e3f6741bc03.zip |
Added preliminary support of new buffer type, with free content
Diffstat (limited to 'src/plugins/scripts/python/weechat-python-api.c')
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 20b80882a..39691c1e9 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -1599,6 +1599,85 @@ weechat_python_api_prnt (PyObject *self, PyObject *args) } /* + * weechat_python_api_prnt_date_tags: print message in a buffer with optional + * date and tags + */ + +static PyObject * +weechat_python_api_prnt_date_tags (PyObject *self, PyObject *args) +{ + char *buffer, *tags, *message; + int date; + + /* make C compiler happy */ + (void) self; + + if (!python_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("prnt_date_tags"); + PYTHON_RETURN_ERROR; + } + + buffer = NULL; + date = 0; + tags = NULL; + message = NULL; + + if (!PyArg_ParseTuple (args, "siss", &buffer, &time, &tags, &message)) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("prnt_date_tags"); + PYTHON_RETURN_ERROR; + } + + script_api_printf_date_tags (weechat_python_plugin, + python_current_script, + script_str2ptr (buffer), + date, + tags, + "%s", message); + + PYTHON_RETURN_OK; +} + +/* + * weechat_python_api_prnt_y: print message in a buffer with free content + */ + +static PyObject * +weechat_python_api_prnt_y (PyObject *self, PyObject *args) +{ + char *buffer, *message; + int y; + + /* make C compiler happy */ + (void) self; + + if (!python_current_script) + { + WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("prnt_y"); + PYTHON_RETURN_ERROR; + } + + buffer = NULL; + y = 0; + message = NULL; + + if (!PyArg_ParseTuple (args, "sis", &buffer, &y, &message)) + { + WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("prnt_y"); + PYTHON_RETURN_ERROR; + } + + script_api_printf_y (weechat_python_plugin, + python_current_script, + script_str2ptr (buffer), + y, + "%s", message); + + PYTHON_RETURN_OK; +} + +/* * weechat_python_api_infobar_print: print message to infobar */ @@ -3735,6 +3814,8 @@ PyMethodDef weechat_python_funcs[] = { "prefix", &weechat_python_api_prefix, METH_VARARGS, "" }, { "color", &weechat_python_api_color, METH_VARARGS, "" }, { "prnt", &weechat_python_api_prnt, METH_VARARGS, "" }, + { "prnt_date_tags", &weechat_python_api_prnt_date_tags, METH_VARARGS, "" }, + { "prnt_y", &weechat_python_api_prnt_y, METH_VARARGS, "" }, { "infobar_print", &weechat_python_api_infobar_print, METH_VARARGS, "" }, { "infobar_remove", &weechat_python_api_infobar_remove, METH_VARARGS, "" }, { "log_print", &weechat_python_api_log_print, METH_VARARGS, "" }, |