diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2022-10-22 12:32:18 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-11 15:33:11 +0100 |
commit | dc8a35796a1c47bf70e891d9728265590823d52f (patch) | |
tree | 549f654c23d4f8e2d78d0b3c986045b64b400870 /src/plugins/python | |
parent | abdabb3ae46061c00e4cd975710e6415672fd8cb (diff) | |
download | weechat-dc8a35796a1c47bf70e891d9728265590823d52f.zip |
doc/api: Improve python example for config_new_section
This updates the Python examples to include all the possible return
values for the callbacks in config_new_section, like it is done in the C
example. It also aligns the order of the values with the C example.
Diffstat (limited to 'src/plugins/python')
-rw-r--r-- | src/plugins/python/weechat.pyi | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/python/weechat.pyi b/src/plugins/python/weechat.pyi index bf4d6bc2f..f5a57f20e 100644 --- a/src/plugins/python/weechat.pyi +++ b/src/plugins/python/weechat.pyi @@ -496,24 +496,34 @@ def config_new_section(config_file: str, name: str, # ... return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED # return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE - # return weechat.WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND # return weechat.WEECHAT_CONFIG_OPTION_SET_ERROR + # return weechat.WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND def my_section_write_cb(data: str, config_file: str, section_name: str) -> int: # ... return weechat.WEECHAT_CONFIG_WRITE_OK + # return weechat.WEECHAT_CONFIG_WRITE_ERROR + # return weechat.WEECHAT_CONFIG_WRITE_MEMORY_ERROR def my_section_write_default_cb(data: str, config_file: str, section_name: str) -> int: # ... return weechat.WEECHAT_CONFIG_WRITE_OK + # return weechat.WEECHAT_CONFIG_WRITE_ERROR + # return weechat.WEECHAT_CONFIG_WRITE_MEMORY_ERROR def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int: # ... - return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE + return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED + # return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE + # return weechat.WEECHAT_CONFIG_OPTION_SET_ERROR + # return weechat.WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND def my_section_delete_option_cb(data: str, config_file: str, section: str, option: str) -> int: # ... return weechat.WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED + # return weechat.WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET + # return weechat.WEECHAT_CONFIG_OPTION_UNSET_OK_RESET + # return weechat.WEECHAT_CONFIG_OPTION_UNSET_ERROR section = weechat.config_new_section(config_file, "section1", 1, 1, "my_section_read_cb", "", |