about summary refs log tree commit diff stats
path: root/src/plugins/python_api.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-02-28 23:12:53 +0000
committerJames Booth <boothj5@gmail.com>2016-02-28 23:12:53 +0000
commit21f6e88c3b4dc8a48821cc74b22afa50f76ae7a7 (patch)
treeef64303f90edf18edbeb2553b67709bc6d091be0 /src/plugins/python_api.c
parentc81b05b91976af970d1b5171a8d8b14193d395dd (diff)
downloadprofani-tty-21f6e88c3b4dc8a48821cc74b22afa50f76ae7a7.tar.gz
Added current_win_is_console to python API
Diffstat (limited to 'src/plugins/python_api.c')
-rw-r--r--src/plugins/python_api.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c
index a992419d..22b99486 100644
--- a/src/plugins/python_api.c
+++ b/src/plugins/python_api.c
@@ -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" },