summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/python
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-05-17 15:49:58 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-05-17 15:49:58 +0200
commit353538e3d80a1f90c2f3149b82d4be680ede0cdb (patch)
treef0d64a8cadd1ea1e8bdf5e044f759c8c31e358c2 /src/plugins/scripts/python
parent1076183317b7e4f7e9bf3bd9bac139cd620136cb (diff)
downloadweechat-353538e3d80a1f90c2f3149b82d4be680ede0cdb.zip
Add function "config_is_set_plugin" in plugin/script API
Diffstat (limited to 'src/plugins/scripts/python')
-rw-r--r--src/plugins/scripts/python/weechat-python-api.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c
index 6cf94d2e3..0c58130b1 100644
--- a/src/plugins/scripts/python/weechat-python-api.c
+++ b/src/plugins/scripts/python/weechat-python-api.c
@@ -2387,6 +2387,40 @@ weechat_python_api_config_get_plugin (PyObject *self, PyObject *args)
}
/*
+ * weechat_python_api_config_is_set_plugin: check if a plugin option is set
+ */
+
+static PyObject *
+weechat_python_api_config_is_set_plugin (PyObject *self, PyObject *args)
+{
+ char *option;
+ int rc;
+
+ /* make C compiler happy */
+ (void) self;
+
+ if (!python_current_script)
+ {
+ WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "config_is_set_plugin");
+ PYTHON_RETURN_INT(0);
+ }
+
+ option = NULL;
+
+ if (!PyArg_ParseTuple (args, "s", &option))
+ {
+ WEECHAT_SCRIPT_MSG_WRONG_ARGS(PYTHON_CURRENT_SCRIPT_NAME, "config_is_set_plugin");
+ PYTHON_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
+ }
+
+ rc = script_api_config_is_set_plugin (weechat_python_plugin,
+ python_current_script,
+ option);
+
+ PYTHON_RETURN_INT(rc);
+}
+
+/*
* weechat_python_api_config_set_plugin: set value of a plugin option
*/
@@ -5924,6 +5958,7 @@ PyMethodDef weechat_python_funcs[] =
{ "config_free", &weechat_python_api_config_free, METH_VARARGS, "" },
{ "config_get", &weechat_python_api_config_get, METH_VARARGS, "" },
{ "config_get_plugin", &weechat_python_api_config_get_plugin, METH_VARARGS, "" },
+ { "config_is_set_plugin", &weechat_python_api_config_is_set_plugin, METH_VARARGS, "" },
{ "config_set_plugin", &weechat_python_api_config_set_plugin, METH_VARARGS, "" },
{ "config_unset_plugin", &weechat_python_api_config_unset_plugin, METH_VARARGS, "" },
{ "prefix", &weechat_python_api_prefix, METH_VARARGS, "" },