mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 04:16:38 +02:00
api: add functions config_{boolean|integer|string|color|enum}_inherited in scripting API
This commit is contained in:
@@ -1573,6 +1573,21 @@ API_FUNC(config_boolean_default)
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
API_FUNC(config_boolean_inherited)
|
||||
{
|
||||
char *option;
|
||||
int value;
|
||||
|
||||
API_INIT_FUNC(1, "config_boolean_inherited", API_RETURN_INT(0));
|
||||
option = NULL;
|
||||
if (!PyArg_ParseTuple (args, "s", &option))
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
value = weechat_config_boolean_inherited (API_STR2PTR(option));
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
API_FUNC(config_integer)
|
||||
{
|
||||
char *option;
|
||||
@@ -1603,6 +1618,21 @@ API_FUNC(config_integer_default)
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
API_FUNC(config_integer_inherited)
|
||||
{
|
||||
char *option;
|
||||
int value;
|
||||
|
||||
API_INIT_FUNC(1, "config_integer_inherited", API_RETURN_INT(0));
|
||||
option = NULL;
|
||||
if (!PyArg_ParseTuple (args, "s", &option))
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
value = weechat_config_integer_inherited (API_STR2PTR(option));
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
API_FUNC(config_string)
|
||||
{
|
||||
char *option;
|
||||
@@ -1633,6 +1663,21 @@ API_FUNC(config_string_default)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(config_string_inherited)
|
||||
{
|
||||
char *option;
|
||||
const char *result;
|
||||
|
||||
API_INIT_FUNC(1, "config_string_inherited", API_RETURN_EMPTY);
|
||||
option = NULL;
|
||||
if (!PyArg_ParseTuple (args, "s", &option))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
result = weechat_config_string_inherited (API_STR2PTR(option));
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(config_color)
|
||||
{
|
||||
char *option;
|
||||
@@ -1663,6 +1708,21 @@ API_FUNC(config_color_default)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(config_color_inherited)
|
||||
{
|
||||
char *option;
|
||||
const char *result;
|
||||
|
||||
API_INIT_FUNC(1, "config_color_inherited", API_RETURN_EMPTY);
|
||||
option = NULL;
|
||||
if (!PyArg_ParseTuple (args, "s", &option))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
result = weechat_config_color_inherited (API_STR2PTR(option));
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(config_enum)
|
||||
{
|
||||
char *option;
|
||||
@@ -1693,6 +1753,21 @@ API_FUNC(config_enum_default)
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
API_FUNC(config_enum_inherited)
|
||||
{
|
||||
char *option;
|
||||
int value;
|
||||
|
||||
API_INIT_FUNC(1, "config_enum_inherited", API_RETURN_INT(0));
|
||||
option = NULL;
|
||||
if (!PyArg_ParseTuple (args, "s", &option))
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
value = weechat_config_enum_inherited (API_STR2PTR(option));
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
API_FUNC(config_write_option)
|
||||
{
|
||||
char *config_file, *option;
|
||||
@@ -5591,14 +5666,19 @@ PyMethodDef weechat_python_funcs[] =
|
||||
API_DEF_FUNC(config_option_default_is_null),
|
||||
API_DEF_FUNC(config_boolean),
|
||||
API_DEF_FUNC(config_boolean_default),
|
||||
API_DEF_FUNC(config_boolean_inherited),
|
||||
API_DEF_FUNC(config_integer),
|
||||
API_DEF_FUNC(config_integer_default),
|
||||
API_DEF_FUNC(config_integer_inherited),
|
||||
API_DEF_FUNC(config_string),
|
||||
API_DEF_FUNC(config_string_default),
|
||||
API_DEF_FUNC(config_string_inherited),
|
||||
API_DEF_FUNC(config_color),
|
||||
API_DEF_FUNC(config_color_default),
|
||||
API_DEF_FUNC(config_color_inherited),
|
||||
API_DEF_FUNC(config_enum),
|
||||
API_DEF_FUNC(config_enum_default),
|
||||
API_DEF_FUNC(config_enum_inherited),
|
||||
API_DEF_FUNC(config_write_option),
|
||||
API_DEF_FUNC(config_write_line),
|
||||
API_DEF_FUNC(config_write),
|
||||
|
||||
@@ -795,6 +795,17 @@ def config_boolean_default(option: str) -> int:
|
||||
...
|
||||
|
||||
|
||||
def config_boolean_inherited(option: str) -> int:
|
||||
"""`config_boolean_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_boolean_inherited>`_
|
||||
::
|
||||
|
||||
# example
|
||||
option = weechat.config_get("irc.server.libera.autoconnect")
|
||||
autoconect = weechat.config_boolean_inherited(option)
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
def config_integer(option: str) -> int:
|
||||
"""`config_integer in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_integer>`_
|
||||
::
|
||||
@@ -817,6 +828,17 @@ def config_integer_default(option: str) -> int:
|
||||
...
|
||||
|
||||
|
||||
def config_integer_inherited(option: str) -> int:
|
||||
"""`config_integer_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_integer_inherited>`_
|
||||
::
|
||||
|
||||
# example
|
||||
option = weechat.config_get("irc.server.libera.autojoin_delay")
|
||||
delay = weechat.config_integer_inherited(option)
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
def config_string(option: str) -> str:
|
||||
"""`config_string in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_string>`_
|
||||
::
|
||||
@@ -839,13 +861,24 @@ def config_string_default(option: str) -> str:
|
||||
...
|
||||
|
||||
|
||||
def config_string_inherited(option: str) -> str:
|
||||
"""`config_string_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_string_inherited>`_
|
||||
::
|
||||
|
||||
# example
|
||||
option = weechat.config_get("irc.server.libera.msg_quit")
|
||||
msg_quit = weechat.config_string_inherited(option)
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
def config_color(option: str) -> str:
|
||||
"""`config_color in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_color>`_
|
||||
::
|
||||
|
||||
# example
|
||||
option = weechat.config_get("plugin.section.option")
|
||||
value = weechat.config_color(option)
|
||||
color = weechat.config_color(option)
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -856,7 +889,18 @@ def config_color_default(option: str) -> str:
|
||||
|
||||
# example
|
||||
option = weechat.config_get("plugin.section.option")
|
||||
value = weechat.config_color_default(option)
|
||||
color = weechat.config_color_default(option)
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
def config_color_inherited(option: str) -> str:
|
||||
"""`config_color_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_color_inherited>`_
|
||||
::
|
||||
|
||||
# example
|
||||
option = weechat.config_get("plugin.section.option")
|
||||
color = weechat.config_color_inherited(option)
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -883,6 +927,17 @@ def config_enum_default(option: str) -> int:
|
||||
...
|
||||
|
||||
|
||||
def config_enum_inherited(option: str) -> int:
|
||||
"""`config_enum_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_enum_inherited>`_
|
||||
::
|
||||
|
||||
# example
|
||||
option = weechat.config_get("irc.server.libera.sasl_fail")
|
||||
sasl_fail = weechat.config_enum_inherited(option)
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
def config_write_option(config_file: str, option: str) -> int:
|
||||
"""`config_write_option in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_write_option>`_
|
||||
::
|
||||
|
||||
Reference in New Issue
Block a user