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-04-30 23:00:07 +0100
committerJames Booth <boothj5@gmail.com>2016-04-30 23:00:07 +0100
commit623fbe9e4727f80ff3adaf820f3133e918a3f87e (patch)
treec43c52297197513d7c5e503a4526586c73c16c68 /src/plugins/python_api.c
parenta718e6f91b53139e35450fb119a3ccd83e48ab26 (diff)
downloadprofani-tty-623fbe9e4727f80ff3adaf820f3133e918a3f87e.tar.gz
Plugins: Added prof_disco_add_feature()
Diffstat (limited to 'src/plugins/python_api.c')
-rw-r--r--src/plugins/python_api.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c
index 34e81f11..5c4cf913 100644
--- a/src/plugins/python_api.c
+++ b/src/plugins/python_api.c
@@ -665,6 +665,21 @@ python_api_incoming_message(PyObject *self, PyObject *args)
     return Py_BuildValue("");
 }
 
+static PyObject*
+python_api_disco_add_feature(PyObject *self, PyObject *args)
+{
+    char *feature = NULL;
+    if (!PyArg_ParseTuple(args, "s", &feature)) {
+        return Py_BuildValue("");
+    }
+
+    allow_python_threads();
+    api_disco_add_feature(feature);
+    disable_python_threads();
+
+    return Py_BuildValue("");
+}
+
 void
 python_command_callback(PluginCommand *command, gchar **args)
 {
@@ -766,6 +781,7 @@ static PyMethodDef apiMethods[] = {
     { "settings_get_int", python_api_settings_get_int, METH_VARARGS, "Get a integer setting." },
     { "settings_set_int", python_api_settings_set_int, METH_VARARGS, "Set a integer setting." },
     { "incoming_message", python_api_incoming_message, METH_VARARGS, "Show an incoming message." },
+    { "disco_add_feature", python_api_disco_add_feature, METH_VARARGS, "Add a feature to disco info response." },
     { NULL, NULL, 0, NULL }
 };