1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Added current_win_is_console to python API

This commit is contained in:
James Booth 2016-02-28 23:12:53 +00:00
parent c81b05b919
commit 21f6e88c3b

View File

@ -244,6 +244,17 @@ python_api_get_current_muc(PyObject *self, PyObject *args)
}
}
static PyObject*
python_api_current_win_is_console(PyObject *self, PyObject *args)
{
int res = api_current_win_is_console();
if (res) {
return Py_BuildValue("O", Py_True);
} else {
return Py_BuildValue("O", Py_False);
}
}
static PyObject *
python_api_log_debug(PyObject *self, PyObject *args)
{
@ -443,6 +454,7 @@ static PyMethodDef apiMethods[] = {
{ "notify", python_api_notify, METH_VARARGS, "Send desktop notification." },
{ "get_current_recipient", python_api_get_current_recipient, METH_VARARGS, "Return the jid of the recipient of the current window." },
{ "get_current_muc", python_api_get_current_muc, METH_VARARGS, "Return the jid of the room of the current window." },
{ "current_win_is_console", python_api_current_win_is_console, METH_VARARGS, "Returns whether the current window is the console." },
{ "log_debug", python_api_log_debug, METH_VARARGS, "Log a debug message" },
{ "log_info", python_api_log_info, METH_VARARGS, "Log an info message" },
{ "log_warning", python_api_log_warning, METH_VARARGS, "Log a warning message" },