diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-05-13 19:39:46 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-05-13 20:24:59 +0200 |
commit | fafe2c9d2e3474037efa43d342a7277170972c12 (patch) | |
tree | 06ad6131e9ab958ac4baf00545b314e03414d821 /doc/en | |
parent | 3e122ed900319d22c483a9def13eb3f2068cd251 (diff) | |
download | weechat-fafe2c9d2e3474037efa43d342a7277170972c12.zip |
doc: add type annotations in Python prototypes (plugin API reference) (issue #1377)
Diffstat (limited to 'doc/en')
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 435 |
1 files changed, 219 insertions, 216 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 087ab73d4..0092c57ad 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -290,7 +290,7 @@ Script (Python): [source,python] ---- # prototype -weechat.register(name, author, version, license, description, shutdown_function, charset) +def register(name: str, author: str, version: str, license: str, description: str, shutdown_function: str, charset: str) -> int: ... ---- [NOTE] @@ -332,7 +332,7 @@ Script (Python): [source,python] ---- # prototype -name = weechat.plugin_get_name(plugin) +def plugin_get_name(plugin: str) -> str: ... # example plugin = weechat.buffer_get_pointer(weechat.current_buffer(), "plugin") @@ -374,7 +374,7 @@ Script (Python): [source,python] ---- # prototype -weechat.charset_set(charset) +def charset_set(charset: str) -> int: ... # example weechat.charset_set("iso-8859-1") @@ -414,7 +414,7 @@ Script (Python): [source,python] ---- # prototype -str = weechat.iconv_to_internal(charset, string) +def iconv_to_internal(charset: str, string: str) -> str: ... # example str = weechat.iconv_to_internal("iso-8859-1", "iso string: é à") @@ -454,7 +454,7 @@ Script (Python): [source,python] ---- # prototype -str = weechat.iconv_from_internal(charset, string) +def iconv_from_internal(charset: str, string: str) -> str: ... # example str = weechat.iconv_from_internal("iso-8859-1", "utf-8 string: é à") @@ -491,7 +491,7 @@ Script (Python): [source,python] ---- # prototype -str = weechat.gettext(string) +def gettext(string: str) -> str: ... # example str = weechat.gettext("hello") @@ -534,7 +534,7 @@ Script (Python): [source,python] ---- # prototype -str = weechat.ngettext(string, plural, count) +def ngettext(string: str, plural: str, count) -> str: ... # example num_files = 2 @@ -886,7 +886,7 @@ Script (Python): [source,python] ---- # prototype -length = weechat.strlen_screen(string) +def strlen_screen(string: str) -> int: ... # example length = weechat.strlen_screen("é") # 1 @@ -937,7 +937,7 @@ Script (Python): [source,python] ---- # prototype -match = weechat.string_match(string, mask, case_sensitive) +def string_match(string: str, mask: str, case_sensitive: int) -> int: ... # examples match1 = weechat.string_match("abcdef", "abc*", 0) # == 1 @@ -990,7 +990,7 @@ Script (Python): [source,python] ---- # prototype -match = weechat.string_match_list(string, masks, case_sensitive) +def string_match_list(string: str, masks: str, case_sensitive: int) -> int: ... # examples match1 = weechat.string_match("abc", "*,!abc*", 0) # == 0 @@ -1090,7 +1090,7 @@ Script (Python): [source,python] ---- # prototype -path = weechat.string_eval_path_home(path, pointers, extra_vars, options) +def string_eval_path_home(path: str, pointers: Dict[str, str], extra_vars: Dict[str, str], options: Dict[str, str]) -> str: ... # example path = weechat.string_eval_path_home("${weechat_config_dir}/test.conf", {}, {}, {}) @@ -1252,7 +1252,7 @@ Script (Python): [source,python] ---- # prototype -regex = weechat.string_mask_to_regex(mask) +def string_mask_to_regex(mask: str) -> str: ... # example regex = weechat.string_mask_to_regex("test*mask") # "test.*mask" @@ -1398,7 +1398,7 @@ Script (Python): [source,python] ---- # prototype -highlight = weechat.string_has_highlight(string, highlight_words) +def string_has_highlight(string: str, highlight_words: str) -> int: ... # example highlight = weechat.string_has_highlight("my test string", "test,word2") # 1 @@ -1441,7 +1441,7 @@ Script (Python): [source,python] ---- # prototype -highlight = weechat.string_has_highlight_regex(string, regex) +def string_has_highlight_regex(string: str, regex: str) -> int: ... # example highlight = weechat.string_has_highlight_regex("my test string", "test|word2") # 1 @@ -1899,7 +1899,7 @@ Script (Python), _WeeChat ≥ 2.2_: [source,python] ---- # prototype -str = weechat.string_format_size(size) +def string_format_size(size: int) -> str: ... # example str = weechat.string_format_size(15200) # == "15.2 KB" @@ -1946,7 +1946,7 @@ Script (Python): [source,python] ---- # prototype -size = weechat.string_color_code_size(string) +def string_color_code_size(string: str) -> int: ... # examples size = weechat.string_color_code_size("test") # size == 0 @@ -1997,7 +1997,7 @@ Script (Python): [source,python] ---- # prototype -str = weechat.string_remove_color(string, replacement) +def string_remove_color(string: str, replacement: str) -> str: ... # example str = weechat.string_remove_color(my_string, "?") @@ -2161,7 +2161,7 @@ Script (Python): [source,python] ---- # prototype -is_cmdchar = weechat.string_is_command_char(string) +def string_is_command_char(string: str) -> int: ... # examples command_char1 = weechat.string_is_command_char("/test") # == 1 @@ -2204,7 +2204,7 @@ Script (Python): [source,python] ---- # prototype -str = weechat.string_input_for_buffer(string) +def string_input_for_buffer(string: str) -> str: ... # examples str1 = weechat.string_input_for_buffer("test") # "test" @@ -2312,7 +2312,7 @@ Script (Python): [source,python] ---- # prototype -str = weechat.string_eval_expression(expr, pointers, extra_vars, options) +def string_eval_expression(expr: str, pointers: Dict[str, str], extra_vars: Dict[str, str], options: Dict[str, str]) -> str: ... # examples @@ -3667,7 +3667,7 @@ Script (Python): [source,python] ---- # prototype -weechat.mkdir_home(directory, mode) +def mkdir_home(directory: str, mode: int) -> int: ... # example weechat.mkdir_home("${weechat_cache_dir}/temp", 0755) @@ -3708,7 +3708,7 @@ Script (Python): [source,python] ---- # prototype -weechat.mkdir(directory, mode) +def mkdir(directory: str, mode: int) -> int: ... # example weechat.mkdir("/tmp/mydir", 0755) @@ -3749,7 +3749,7 @@ Script (Python): [source,python] ---- # prototype -weechat.mkdir_parents(directory, mode) +def mkdir_parents(directory: str, mode: int) -> int: ... # example weechat.mkdir_parents("/tmp/my/dir", 0755) @@ -4035,7 +4035,7 @@ Script (Python): [source,python] ---- # prototype -list = weechat.list_new() +def list_new() -> str: ... # example list = weechat.list_new() @@ -4082,7 +4082,7 @@ Script (Python): [source,python] ---- # prototype -item = weechat.list_add(list, data, where, user_data) +def list_add(list: str, data: str, where: str, user_data: str) -> str: ... # example item = weechat.list_add(list, "my data", weechat.WEECHAT_LIST_POS_SORT, "") @@ -4121,7 +4121,7 @@ Script (Python): [source,python] ---- # prototype -item = weechat.list_search(list, data) +def list_search(list: str, data: str) -> str: ... # example item = weechat.list_search(list, "my data") @@ -4162,7 +4162,7 @@ Script (Python): [source,python] ---- # prototype -pos_item = weechat.list_search_pos(list, data) +def list_search_pos(list: str, data: str) -> int: ... # example pos_item = weechat.list_search_pos(list, "my data") @@ -4201,7 +4201,7 @@ Script (Python): [source,python] ---- # prototype -item = weechat.list_casesearch(list, data) +def list_casesearch(list: str, data: str) -> str: ... # example item = weechat.list_casesearch(list, "my data") @@ -4242,7 +4242,7 @@ Script (Python): [source,python] ---- # prototype -pos_item = weechat.list_casesearch_pos(list, data) +def list_casesearch_pos(list: str, data: str) -> int: ... # example pos_item = weechat.list_casesearch_pos(list, "my data") @@ -4281,7 +4281,7 @@ Script (Python): [source,python] ---- # prototype -item = weechat.list_get(list, position) +def list_get(list: str, position: int) -> str: ... # example item = weechat.list_get(list, 0) @@ -4315,7 +4315,7 @@ Script (Python): [source,python] ---- # prototype -weechat.list_set(item, value) +def list_set(item: str, value: str) -> int: ... # example weechat.list_set(item, "new data") @@ -4352,7 +4352,7 @@ Script (Python): [source,python] ---- # prototype -item = weechat.list_next(item) +def list_next(item: str) -> str: ... # example item = weechat.list_next(item) @@ -4389,7 +4389,7 @@ Script (Python): [source,python] ---- # prototype -item = weechat.list_prev(item) +def list_prev(item: str) -> str: ... # example item = weechat.list_prev(item) @@ -4426,7 +4426,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.list_string(item) +def list_string(item: str) -> str: ... # example weechat.prnt("", "value of item: %s" % weechat.list_string(item)) @@ -4494,7 +4494,7 @@ Script (Python): [source,python] ---- # prototype -size = weechat.list_size(list) +def list_size(list: str) -> int: ... # example weechat.prnt("", "size of list: %d" % weechat.list_size(list)) @@ -4529,7 +4529,7 @@ Script (Python): [source,python] ---- # prototype -weechat.list_remove(list, item) +def list_remove(list: str, item: str) -> int: ... # example weechat.list_remove(list, item) @@ -4562,7 +4562,7 @@ Script (Python): [source,python] ---- # prototype -weechat.list_remove_all(list) +def list_remove_all(list: str) -> int: ... # example weechat.list_remove_all(list) @@ -4595,7 +4595,7 @@ Script (Python): [source,python] ---- # prototype -weechat.list_free(list) +def list_free(list: str) -> int: ... # example weechat.list_free(list) @@ -5676,7 +5676,7 @@ Script (Python): [source,python] ---- # prototype -config_file = weechat.config_new(name, callback_reload, callback_reload_data) +def config_new(name: str, callback_reload: str, callback_reload_data: str) -> str: ... # example def my_config_reload_cb(data, config_file): @@ -5934,12 +5934,12 @@ Script (Python): [source,python] ---- # prototype -section = weechat.config_new_section(config_file, name, - user_can_add_options, user_can_delete_options, - callback_read, callback_read_data, - callback_write, callback_write_data, - callback_create_option, callback_create_option_data, - callback_delete_option, callback_delete_option_data) +def config_new_section(config_file: str, name: str, + user_can_add_options: int, user_can_delete_options: int, + callback_read: str, callback_read_data: str, + callback_write: str, callback_write_data: str, + callback_create_option: str, callback_create_option_data: str, + callback_delete_option: str, callback_delete_option_data: str) -> str: ... # example def my_section_read_cb(data, config_file, section, option_name, value): @@ -6008,7 +6008,7 @@ Script (Python): [source,python] ---- # prototype -section = weechat.config_search_section(config_file, section_name) +def config_search_section(config_file: str, section_name: str) -> str: ... # example section = weechat.config_search_section(config_file, "section") @@ -6190,11 +6190,12 @@ Script (Python): [source,python] ---- # prototype -option = weechat.config_new_option(config_file, section, name, type, description, - string_values, min, max, default_value, value, null_value_allowed, - callback_check_value, callback_check_value_data, - callback_change, callback_change_data, - callback_delete, callback_delete_data) +def config_new_option(config_file: str, section: str, name: str, type: str, description: str, + string_values: str, min: int, max: int, + default_value: str, value: str, null_value_allowed: int, + callback_check_value: str, callback_check_value_data: str, + callback_change: str, callback_change_data: str, + callback_delete: str, callback_delete_data: str) -> str: ... # example def option4_check_value_cb(data, option, value): @@ -6288,7 +6289,7 @@ Script (Python): [source,python] ---- # prototype -option = weechat.config_search_option(config_file, section, option_name) +def config_search_option(config_file: str, section: str, option_name: str) -> str: ... # example option = weechat.config_search_option(config_file, section, "option") @@ -6437,7 +6438,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_string_to_boolean(text) +def config_string_to_boolean(text: str) -> int: ... # example if weechat.config_string_to_boolean(text): @@ -6491,7 +6492,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_option_reset(option, run_callback) +def config_option_reset(option: str, run_callback: int) -> int: ... # example rc = weechat.config_option_reset(option, 1) @@ -6557,7 +6558,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_option_set(option, value, run_callback) +def config_option_set(option: str, value: str, run_callback: int) -> int: ... # example rc = weechat.config_option_set(option, "new_value", 1) @@ -6620,7 +6621,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_option_set_null(option, run_callback) +def config_option_set_null(option: str, run_callback: int) -> int: ... # example rc = weechat.config_option_set_null(option, 1) @@ -6680,7 +6681,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_option_unset(option) +def config_option_unset(option: str) -> int: ... # example rc = weechat.config_option_unset(option) @@ -6723,7 +6724,7 @@ Script (Python): [source,python] ---- # prototype -weechat.config_option_rename(option, new_name) +def config_option_rename(option: str, new_name: str) -> int: ... # example weechat.config_option_rename(option, "new_name") @@ -6855,7 +6856,7 @@ Script (Python): [source,python] ---- # prototype -is_null = weechat.config_option_is_null(option) +def config_option_is_null(option: str) -> int: ... # example if weechat.config_option_is_null(option): @@ -6901,7 +6902,7 @@ Script (Python): [source,python] ---- # prototype -is_null = weechat.config_option_default_is_null(option) +def config_option_default_is_null(option: str) -> int: ... # example if weechat.config_option_default_is_null(option): @@ -6950,7 +6951,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_boolean(option) +def config_boolean(option: str) -> int: ... # example option = weechat.config_get("plugin.section.option") @@ -7000,7 +7001,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_boolean_default(option) +def config_boolean_default(option: str) -> int: ... # example option = weechat.config_get("plugin.section.option") @@ -7043,7 +7044,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_integer(option) +def config_integer(option: str) -> int: ... # example option = weechat.config_get("plugin.section.option") @@ -7085,7 +7086,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_integer_default(option) +def config_integer_default(option: str) -> int: ... # example option = weechat.config_get("plugin.section.option") @@ -7128,7 +7129,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_string(option) +def config_string(option: str) -> str: ... # example option = weechat.config_get("plugin.section.option") @@ -7171,7 +7172,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_string_default(option) +def config_string_default(option: str) -> str: ... # example option = weechat.config_get("plugin.section.option") @@ -7213,7 +7214,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_color(option) +def config_color(option: str) -> str: ... # example option = weechat.config_get("plugin.section.option") @@ -7255,7 +7256,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_color_default(option) +def config_color_default(option: str) -> str: ... # example option = weechat.config_get("plugin.section.option") @@ -7302,7 +7303,7 @@ Script (Python): [source,python] ---- # prototype -weechat.config_write_option(config_file, option) +def config_write_option(config_file: str, option: str) -> int: ... # example def my_section_write_cb(data, config_file, section_name): @@ -7355,7 +7356,7 @@ Script (Python): [source,python] ---- # prototype -weechat.config_write_line(config_file, option_name, value) +def config_write_line(config_file: str, option_name: str, value: str) -> int: ... # example def my_section_write_cb(data, config_file, section_name): @@ -7408,7 +7409,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_write(config_file) +def config_write(config_file: str) -> int: ... # example rc = weechat.config_write(config_file) @@ -7464,7 +7465,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_read(config_file) +def config_read(config_file: str) -> int: ... # example rc = weechat.config_read(config_file) @@ -7520,7 +7521,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_reload(config_file) +def config_reload(config_file: str) -> int: ... # example rc = weechat.config_reload(config_file) @@ -7559,7 +7560,7 @@ Script (Python): [source,python] ---- # prototype -weechat.config_option_free(option) +def config_option_free(option: str) -> int: ... # example weechat.config_option_free(option) @@ -7592,7 +7593,7 @@ Script (Python): [source,python] ---- # prototype -weechat.config_section_free_options(section) +def config_section_free_options(section: str) -> int: ... # example weechat.config_section_free_options(section) @@ -7625,7 +7626,7 @@ Script (Python): [source,python] ---- # prototype -weechat.config_section_free(section) +def config_section_free(section: str) -> int: ... # example weechat.config_section_free(section) @@ -7658,7 +7659,7 @@ Script (Python): [source,python] ---- # prototype -weechat.config_free(config_file) +def config_free(config_file: str) -> int: ... # example weechat.config_free(config_file) @@ -7695,7 +7696,7 @@ Script (Python): [source,python] ---- # prototype -option = weechat.config_get(option_name) +def config_get(option_name: str) -> str: ... # example option = weechat.config_get("weechat.look.item_time_format") @@ -7735,7 +7736,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_get_plugin(option_name) +def config_get_plugin(option_name: str) -> str: ... # example value = weechat.config_get_plugin("option") @@ -7780,7 +7781,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.config_is_set_plugin(option_name) +def config_is_set_plugin(option_name: str) -> int: ... # example if weechat.config_is_set_plugin("option"): @@ -7841,7 +7842,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_set_plugin(option_name, value) +def config_set_plugin(option_name: str, value: str) -> int: ... # example rc = weechat.config_set_plugin("option", "test_value") @@ -7891,7 +7892,7 @@ Script (Python): [source,python] ---- # prototype -weechat.config_set_desc_plugin(option_name, description) +def config_set_desc_plugin(option_name: str, description: str) -> int: ... # example version = weechat.info_get("version_number", "") or 0 @@ -7948,7 +7949,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.config_unset_plugin(option_name) +def config_unset_plugin(option_name: str) -> int: ... # example rc = weechat.config_unset_plugin("option") @@ -8025,7 +8026,7 @@ Script (Python): [source,python] ---- # prototype -num_keys = weechat.key_bind(context, keys) +def key_bind(context: str, keys: Dict[str, str]) -> int: ... # example keys = {"@chat(python.test):button1": "hsignal:test_mouse", @@ -8077,7 +8078,7 @@ Script (Python): [source,python] ---- # prototype -num_keys = weechat.key_unbind(context, key) +def key_unbind(context: str, key: str) -> int: ... # examples @@ -8140,7 +8141,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.prefix(prefix) +def prefix(prefix: str) -> str: ... # example weechat.prnt("", "%sThis is an error..." % weechat.prefix("error")) @@ -8222,7 +8223,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.color(color_name) +def color(color_name: str) -> str: ... # example weechat.prnt("", "Color: %sblue %sdefault color %syellow on red" @@ -8282,7 +8283,7 @@ Script (Python): [source,python] ---- # prototype -weechat.prnt(buffer, message) +def prnt(buffer: str, message: str) -> int: ... # example weechat.prnt("", "Hello on WeeChat buffer") @@ -8331,7 +8332,7 @@ Script (Python): [source,python] ---- # prototype -weechat.prnt_date_tags(buffer, date, tags, message) +def prnt_date_tags(buffer: str, date: str, tags: str, message: str) -> int: ... # example time = int(time.time()) @@ -8375,7 +8376,7 @@ Script (Python): [source,python] ---- # prototype -weechat.prnt_y(buffer, y, message) +def prnt_y(buffer: str, y: int, message: str) -> int: ... # example weechat.prnt_y("", 2, "My message on third line") @@ -8411,7 +8412,7 @@ Script (Python): [source,python] ---- # prototype -weechat.log_print(message) +def log_print(message: str) -> int: ... # example weechat.log_print("My message in log file") @@ -8584,8 +8585,8 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_command(command, description, args, args_description, - completion, callback, callback_data) +def hook_command(command: str, description: str, args: str, args_description: str, + completion: str, callback: str, callback_data: str) -> str: ... # example def my_command_cb(data, buffer, args): @@ -8690,7 +8691,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_completion(completion_item, description, callback, callback_data) +def hook_completion(completion_item: str, description: str, callback: str, callback_data: str) -> str: ... # example def my_completion_cb(data, completion_item, buffer, completion): @@ -8777,7 +8778,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_command_run(command, callback, callback_data) +def hook_command_run(command: str, callback: str, callback_data: str) -> str: ... # example def my_command_run_cb(data, buffer, command): @@ -8851,7 +8852,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_timer(interval, align_second, max_calls, callback, callback_data) +def hook_timer(interval: int, align_second: int, max_calls: int, callback: str, callback_data: str) -> str: ... # example def my_timer_cb(data, remaining_calls): @@ -8935,7 +8936,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_fd(fd, flag_read, flag_write, flag_exception, callback, callback_data) +def hook_fd(fd: int, flag_read: int, flag_write: int, flag_exception: int, callback: str, callback_data: str) -> str: ... # example def my_fd_cb(data, fd): @@ -9134,7 +9135,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_process(command, timeout, callback, callback_data) +def hook_process(command: str, timeout: int, callback: str, callback_data: str) -> str: ... # example with an external command def my_process_cb(data, command, return_code, out, err): @@ -9368,7 +9369,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_process_hashtable(command, options, timeout, callback, callback_data) +def hook_process_hashtable(command: str, options: Dict[str, str], timeout: int, callback: str, callback_data: str) -> str: ... # example def my_process_cb(data, command, return_code, out, err): @@ -9565,8 +9566,8 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_connect(proxy, address, port, ipv6, retry, local_hostname, - callback, callback_data) +def hook_connect(proxy: str, address: str, port: int, ipv6: int, retry: int, local_hostname: str, + callback: str, callback_data: str) -> str: ... # example def my_connect_cb(data, status, gnutls_rc, sock, error, ip_address): @@ -9860,7 +9861,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_line(buffer_type, buffer_name, tags, callback, callback_data) +def hook_line(buffer_type: str, buffer_name: str, tags: str, callback: str, callback_data: str) -> str: ... # example def my_line_cb(data, line): @@ -9970,7 +9971,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_print(buffer, tags, message, strip_colors, callback, callback_data) +def hook_print(buffer: str, tags: str, message: str, strip_colors: int, callback: str, callback_data: str) -> str: ... # example def my_print_cb(data, buffer, date, tags, displayed, highlight, prefix, message): @@ -10883,7 +10884,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_signal(signal, callback, callback_data) +def hook_signal(signal: str, callback: str, callback_data: str) -> str: ... # example def my_signal_cb(data, signal, signal_data): @@ -10934,7 +10935,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.hook_signal_send(signal, type_data, signal_data) +def hook_signal_send(signal: str, type_data: str, signal_data: str) -> int: ... # example rc = weechat.hook_signal_send("my_signal", weechat.WEECHAT_HOOK_SIGNAL_STRING, my_string) @@ -11223,7 +11224,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_hsignal(signal, callback, callback_data) +def hook_hsignal(signal: str, callback: str, callback_data: str) -> str: ... # example def my_hsignal_cb(data, signal, hashtable): @@ -11282,7 +11283,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.hook_hsignal_send(signal, hashtable) +def hook_hsignal_send(signal: str, hashtable: Dict[str, str]) -> int: ... # example rc = weechat.hook_hsignal_send("my_hsignal", {"key": "value"}) @@ -11529,7 +11530,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_config(option, callback, callback_data) +def hook_config(option: str, callback: str, callback_data: str) -> str: ... # example def my_config_cb(data, option, value): @@ -11694,7 +11695,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_modifier(modifier, callback, callback_data) +def hook_modifier(modifier: str, callback: str, callback_data: str) -> str: ... # example def my_modifier_cb(data, modifier, modifier_data, string): @@ -11803,7 +11804,7 @@ Script (Python): [source,python] ---- # prototype -weechat.hook_modifier_exec(modifier, modifier_data, string) +def hook_modifier_exec(modifier: str, modifier_data: str, string: str) -> str: ... # example weechat.hook_modifier_exec("my_modifier", my_data, my_string) @@ -11879,7 +11880,8 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_info(info_name, description, args_description, callback, callback_data) +def hook_info(info_name: str, description: str, args_description: str, + callback: str, callback_data: str) -> str: ... # example def my_info_cb(data, info_name, arguments): @@ -11959,8 +11961,8 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_info_hashtable(info_name, description, args_description, - output_description, callback, callback_data) +def hook_info_hashtable(info_name: str, description: str, args_description: str, + output_description: str, callback: str, callback_data: str) -> str: ... # example def my_info_hashtable_cb(data, info_name, hashtable): @@ -12049,8 +12051,8 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_infolist(infolist_name, description, pointer_description, - args_description, callback, callback_data) +def hook_infolist(infolist_name: str, description: str, pointer_description: str, + args_description: str, callback: str, callback_data: str) -> str: ... # example def my_infolist_cb(data, infolist_name, pointer, arguments): @@ -12324,7 +12326,7 @@ Script (Python): [source,python] ---- # prototype -hook = weechat.hook_focus(area, callback, callback_data) +def hook_focus(area: str, callback: str, callback_data: str) -> str: ... # example def my_focus_nicklist_cb(data, info): @@ -12399,7 +12401,7 @@ Script (Python): [source,python] ---- # prototype -weechat.hook_set(hook, property, value) +def hook_set(hook: str, property: str, value: str) -> int: ... # example def my_process_cb(data, command, return_code, out, err): @@ -12441,7 +12443,7 @@ Script (Python): [source,python] ---- # prototype -weechat.unhook(hook) +def unhook(hook: str) -> int: ... # example weechat.unhook(my_hook) @@ -12477,7 +12479,7 @@ Script (Python): [source,python] ---- # prototype -weechat.unhook_all() +def unhook_all() -> int: ... # example weechat.unhook_all() @@ -12577,8 +12579,8 @@ Script (Python): [source,python] ---- # prototype -buffer = weechat.buffer_new(name, input_callback, input_callback_data, - close_callback, close_callback_data) +def buffer_new(name: str, input_callback: str, input_callback_data: str, + close_callback: str, close_callback_data: str) -> str: ... # example def my_input_cb(data, buffer, input_data): @@ -12619,7 +12621,7 @@ Script (Python): [source,python] ---- # prototype -buffer = weechat.current_buffer() +def current_buffer() -> str: ... # example weechat.prnt(weechat.current_buffer(), "Text on current buffer") @@ -12666,7 +12668,7 @@ Script (Python): [source,python] ---- # prototype -buffer = weechat.buffer_search(plugin, name) +def buffer_search(plugin: str, name: str) -> str: ... # example buffer = weechat.buffer_search("my_plugin", "my_buffer") @@ -12700,7 +12702,7 @@ Script (Python): [source,python] ---- # prototype -buffer = weechat.buffer_search_main() +def buffer_search_main() -> str: ... # example buffer = weechat.buffer_search_main() @@ -12738,7 +12740,7 @@ Script (Python): [source,python] ---- # prototype -weechat.buffer_clear(buffer) +def buffer_clear(buffer: str) -> int: ... # example buffer = weechat.buffer_search("my_plugin", "my_buffer") @@ -12777,7 +12779,7 @@ Script (Python): [source,python] ---- # prototype -weechat.buffer_close(buffer) +def buffer_close(buffer: str) -> int: ... # example buffer = weechat.buffer_new("my_buffer", "my_input_cb", "", "my_close_cb", "") @@ -12818,7 +12820,7 @@ Script (Python): [source,python] ---- # prototype -weechat.buffer_merge(buffer, target_buffer) +def buffer_merge(buffer: str, target_buffer: str) -> int: ... # example # merge current buffer with WeeChat "core" buffer @@ -12855,7 +12857,7 @@ Script (Python): [source,python] ---- # prototype -weechat.buffer_unmerge(buffer, number) +def buffer_unmerge(buffer: str, number: int) -> int: ... # example weechat.buffer_unmerge(weechat.current_buffer(), 1) @@ -12947,7 +12949,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.buffer_get_integer(buffer, property) +def buffer_get_integer(buffer: str, property: str) -> int: ... # example weechat.prnt("", "my buffer number is: %d" % weechat.buffer_get_integer(my_buffer, "number")) @@ -13005,7 +13007,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.buffer_get_string(buffer, property) +def buffer_get_string(buffer: str, property: str) -> str: ... # example weechat.prnt("", "name / short name of buffer are: %s / %s" @@ -13050,7 +13052,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.buffer_get_pointer(buffer, property) +def buffer_get_pointer(buffer: str, property: str) -> str: ... # example weechat.prnt("", "plugin pointer of my buffer: %s" % weechat.buffer_get_pointer(my_buffer, "plugin")) @@ -13256,7 +13258,7 @@ Script (Python): [source,python] ---- # prototype -weechat.buffer_set(buffer, property, value) +def buffer_set(buffer: str, property: str, value: str) -> int: ... # examples @@ -13372,7 +13374,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.buffer_string_replace_local_var(buffer, string) +def buffer_string_replace_local_var(buffer: str, string: str) -> str: ... # example weechat.buffer_set(my_buffer, "localvar_set_toto", "abc") @@ -13424,7 +13426,7 @@ Script (Python): [source,python] ---- # prototype -match = weechat.buffer_match_list(buffer, string) +def buffer_match_list(buffer: str, string: str) -> int: ... # example buffer = weechat.buffer_search("irc", "freenode.#weechat") @@ -13467,7 +13469,7 @@ Script (Python): [source,python] ---- # prototype -window = weechat.current_window() +def current_window() -> str: ... # example current_window = weechat.current_window() @@ -13508,7 +13510,7 @@ Script (Python): [source,python] ---- # prototype -window = weechat.window_search_with_buffer(buffer) +def window_search_with_buffer(buffer: str) -> str: ... # example weechat.prnt("", "window displaying core buffer: %s" @@ -13568,7 +13570,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.window_get_integer(window, property) +def window_get_integer(window: str, property: str) -> int: ... # example weechat.prnt("", "current window is at position (x,y): (%d,%d)" @@ -13605,7 +13607,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.window_get_string(window, property) +def window_get_string(window: str, property: str) -> str: ... ---- ==== window_get_pointer @@ -13645,7 +13647,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.window_get_pointer(window, property) +def window_get_pointer(window: str, property: str) -> str: ... # example weechat.prnt("", "buffer displayed in current window: %s" @@ -13681,7 +13683,7 @@ Script (Python): [source,python] ---- # prototype -weechat.window_set_title(window, title) +def window_set_title(title: str) -> int: ... # example weechat.window_set_title("new title here") @@ -13751,7 +13753,7 @@ Script (Python): [source,python] ---- # prototype -group = weechat.nicklist_add_group(buffer, parent_group, name, color, visible) +def nicklist_add_group(buffer: str, parent_group: str, name: str, color: str, visible: int) -> str: ... # example group = weechat.nicklist_add_group(my_buffer, my_parent_group, "test_group", @@ -13795,7 +13797,7 @@ Script (Python): [source,python] ---- # prototype -group = weechat.nicklist_search_group(buffer, from_group, name) +def nicklist_search_group(buffer: str, from_group: str, name: str) -> str: ... # example group = weechat.nicklist_search_group(my_buffer, "", "test_group") @@ -13863,7 +13865,7 @@ Script (Python): [source,python] ---- # prototype -nick = weechat.nicklist_add_nick(buffer, group, name, color, prefix, prefix_color, visible) +def nicklist_add_nick(buffer: str, group: str, name: str, color: str, prefix: str, prefix_color: str, visible: int) -> str: ... # example if nick_away: @@ -13910,7 +13912,7 @@ Script (Python): [source,python] ---- # prototype -nick = weechat.nicklist_search_nick(buffer, from_group, name) +def nicklist_search_nick(buffer: str, from_group: str, name: str) -> str: ... # example nick = weechat.nicklist_search_nick(my_buffer, "", "test_nick") @@ -13945,7 +13947,7 @@ Script (Python): [source,python] ---- # prototype -weechat.nicklist_remove_group(buffer, group) +def nicklist_remove_group(buffer: str, group: str) -> int: ... # example weechat.nicklist_remove_group(my_buffer, my_group) @@ -13980,7 +13982,7 @@ Script (Python): [source,python] ---- # prototype -weechat.nicklist_remove_nick(buffer, nick) +def nicklist_remove_nick(buffer: str, nick: str) -> int: ... # example weechat.nicklist_remove_nick(my_buffer, my_nick) @@ -14013,7 +14015,7 @@ Script (Python): [source,python] ---- # prototype -weechat.nicklist_remove_all(buffer) +def nicklist_remove_all(buffer: str) -> int: ... # example weechat.nicklist_remove_all(my_buffer) @@ -14108,7 +14110,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.nicklist_group_get_integer(buffer, group, property) +def nicklist_group_get_integer(buffer: str, group: str, property: str) -> int: ... # example visible = weechat.nicklist_group_get_integer(buffer, group, "visible") @@ -14153,7 +14155,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.nicklist_group_get_string(buffer, group, property) +def nicklist_group_get_string(buffer: str, group: str, property: str) -> str: ... # example color = weechat.nicklist_group_get_string(buffer, group, "color") @@ -14197,7 +14199,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.nicklist_group_get_pointer(buffer, group, property) +def nicklist_group_get_pointer(buffer: str, group: str, property: str) -> str: ... # example parent = weechat.nicklist_group_get_pointer(buffer, group, "parent") @@ -14258,7 +14260,7 @@ Script (Python): [source,python] ---- # prototype -weechat.nicklist_group_set(buffer, group, property, value) +def nicklist_group_set(buffer: str, group: str, property: str, value: str) -> int: ... # examples @@ -14310,7 +14312,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.nicklist_nick_get_integer(buffer, nick, property) +def nicklist_nick_get_integer(buffer: str, nick: str, property: str) -> int: ... # example visible = weechat.nicklist_nick_get_integer(buffer, nick, "visible") @@ -14357,7 +14359,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.nicklist_nick_get_string(buffer, nick, property) +def nicklist_nick_get_string(buffer: str, nick: str, property: str) -> str: ... # example color = weechat.nicklist_nick_get_string(buffer, nick, "color") @@ -14401,7 +14403,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.nicklist_nick_get_pointer(buffer, nick, property) +def nicklist_nick_get_pointer(buffer: str, nick: str, property: str) -> str: ... # example group = weechat.nicklist_nick_get_pointer(buffer, nick, "group") @@ -14471,7 +14473,7 @@ Script (Python): [source,python] ---- # prototype -weechat.nicklist_nick_set(buffer, nick, property, value) +def nicklist_nick_set(buffer: str, nick: str, property: str, value: str) -> int: ... # examples @@ -14524,7 +14526,7 @@ Script (Python): [source,python] ---- # prototype -bar_item = weechat.bar_item_search(name) +def bar_item_search(name: str) -> str: ... # example bar_item = weechat.bar_item_search("myitem") @@ -14607,7 +14609,7 @@ see example below (supported only in WeeChat ≥ 0.4.2). [source,python] ---- # prototype -bar_item = weechat.bar_item_new(name, build_callback, build_callback_data) +def bar_item_new(name: str, build_callback: str, build_callback_data: str) -> str: ... # example (callback without "buffer" and "extra_info") def my_build_callback(data, item, window): @@ -14649,7 +14651,7 @@ Script (Python): [source,python] ---- # prototype -weechat.bar_item_update(name) +def bar_item_update(name: str) -> int: ... # example weechat.bar_item_update("myitem") @@ -14682,7 +14684,7 @@ Script (Python): [source,python] ---- # prototype -weechat.bar_item_remove(item) +def bar_item_remove(item: str) -> int: ... # example weechat.bar_item_remove(myitem) @@ -14719,7 +14721,7 @@ Script (Python): [source,python] ---- # prototype -bar = weechat.bar_search(name) +def bar_search(name: str) -> str: ... # example bar = weechat.bar_search("mybar") @@ -14824,9 +14826,10 @@ Script (Python): [source,python] ---- # prototype -bar = weechat.bar_new(name, hidden, priority, type, condition, position, - filling_top_bottom, filling_left_right, size, size_max, - color_fg, color_delim, color_bg, color_bg_inactive, separator, items) +def bar_new(name: str, hidden: str, priority: str, type: str, condition: str, position: str, + filling_top_bottom: str, filling_left_right: str, size: str, size_max: str, + color_fg: str, color_delim: str, color_bg: str, color_bg_inactive: str, + separator: str, items: str) -> str: ... # example bar = weechat.bar_new("mybar", "off", "100", "window", "", "top", "horizontal", "vertical", @@ -14875,7 +14878,7 @@ Script (Python): [source,python] ---- # prototype -weechat.bar_set(bar, property, value) +def bar_set(bar: str, property: str, value: str) -> int: ... # example weechat.bar_set(my_bar, "position", "bottom") @@ -14908,7 +14911,7 @@ Script (Python): [source,python] ---- # prototype -weechat.bar_update(name) +def bar_update(name: str) -> int: ... # example weechat.bar_update("mybar") @@ -14941,7 +14944,7 @@ Script (Python): [source,python] ---- # prototype -weechat.bar_remove(bar) +def bar_remove(bar: str) -> int: ... # example weechat.bar_remove(my_bar) @@ -14991,7 +14994,7 @@ Script (Python): [source,python] ---- # prototype -weechat.command(buffer, command) +def command(buffer: str, command: str) -> int: ... # example rc = weechat.command(weechat.buffer_search("irc", "freenode.#weechat"), "/whois FlashCode") @@ -15050,7 +15053,7 @@ Script (Python): [source,python] ---- # prototype -weechat.command_options(buffer, command, options) +def command_options(buffer: str, command: str, options: Dict[str, str]) -> int: ... # example: allow any command except /exec rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) @@ -15094,7 +15097,7 @@ Script (Python): [source,python] ---- # prototype -completion = weechat.completion_new(buffer) +def completion_new(buffer: str) -> str: ... # example completion = weechat.completion_new(weechat.buffer_search_main()) @@ -15142,7 +15145,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.completion_search(completion, data, position, direction) +def completion_search(completion: str, data: str, position: int, direction: int) -> int: ... # example completion = weechat.completion_new(weechat.buffer_search_main()) @@ -15196,7 +15199,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.completion_get_string(completion, property) +def completion_get_string(completion: str, property: str) -> str: ... # example def my_completion_cb(data, completion_item, buffer, completion): @@ -15240,7 +15243,7 @@ Script (Python): [source,python] ---- # prototype -weechat.completion_list_add(completion, word, nick_completion, where) +def completion_list_add(completion: str, word: str, nick_completion: int, where: str) -> int: ... # example: see function hook_completion ---- @@ -15274,7 +15277,7 @@ Script (Python): [source,python] ---- # prototype -weechat.completion_free(completion) +def completion_free(completion: str) -> int: ... # example weechat.completion_free(completion) @@ -15446,7 +15449,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.info_get(info_name, arguments) +def info_get(info_name: str, arguments: str) -> str: ... # example weechat.prnt("", "Current WeeChat version is: %s (compiled on %s)" @@ -15531,7 +15534,7 @@ Script (Python): [source,python] ---- # prototype -dict = weechat.info_get_hashtable(info_name, dict_in) +def info_get_hashtable(info_name: str, dict_in: Dict[str, str]) -> Dict[str, str]: ... # example dict_in = {"message": ":nick!user@host PRIVMSG #weechat :message here"} @@ -15583,7 +15586,7 @@ Script (Python): [source,python] ---- # prototype -infolist = weechat.infolist_new() +def infolist_new() -> str: ... # example infolist = weechat.infolist_new() @@ -15620,7 +15623,7 @@ Script (Python): [source,python] ---- # prototype -item = weechat.infolist_new_item(infolist) +def infolist_new_item(infolist: str) -> str: ... # example item = weechat.infolist_new_item(infolist) @@ -15663,7 +15666,7 @@ Script (Python): [source,python] ---- # prototype -var = weechat.infolist_new_var_integer(item, name, value) +def infolist_new_var_integer(item: str, name: str, value: int) -> str: ... # example var = weechat.infolist_new_var_integer(item, "my_integer", 123) @@ -15706,7 +15709,7 @@ Script (Python): [source,python] ---- # prototype -var = weechat.infolist_new_var_string(item, name, value) +def infolist_new_var_string(item: str, name: str, value: str) -> str: ... # example var = weechat.infolist_new_var_string(item, "my_string", "value") @@ -15749,7 +15752,7 @@ Script (Python): [source,python] ---- # prototype -var = weechat.infolist_new_var_pointer(item, name, pointer) +def infolist_new_var_pointer(item: str, name: str, pointer: str) -> str: ... # example var = weechat.infolist_new_var_pointer(item, "my_pointer", pointer) @@ -15832,7 +15835,7 @@ Script (Python): [source,python] ---- # prototype -var = weechat.infolist_new_var_time(item, name, time) +def infolist_new_var_time(item: str, name: str, time: int) -> str: ... # example var = weechat.infolist_new_var_time(item, "my_time", int(time.time())) @@ -15886,7 +15889,7 @@ Script (Python): [source,python] ---- # prototype -infolist = weechat.infolist_get(infolist_name, pointer, arguments) +def infolist_get(infolist_name: str, pointer: str, arguments: str) -> str: ... # example infolist = weechat.infolist_get("irc_server", "", "") @@ -15931,7 +15934,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.infolist_next(infolist) +def infolist_next(infolist: str) -> int: ... # example rc = weechat.infolist_next(infolist) @@ -15981,7 +15984,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.infolist_prev(infolist) +def infolist_prev(infolist: str) -> int: ... # example rc = weechat.infolist_prev(infolist) @@ -16018,7 +16021,7 @@ Script (Python): [source,python] ---- # prototype -weechat.infolist_reset_item_cursor(infolist) +def infolist_reset_item_cursor(infolist: str) -> int: ... # example weechat.infolist_reset_item_cursor(infolist) @@ -16063,7 +16066,7 @@ Script (Python): [source,python] ---- # prototype -var = weechat.infolist_search_var(infolist, name) +def infolist_search_var(infolist: str, name: str) -> str: ... # example if weechat.infolist_search_var(infolist, "name"): @@ -16106,7 +16109,7 @@ Script (Python): [source,python] ---- # prototype -fields = weechat.infolist_fields(infolist) +def infolist_fields(infolist: str) -> str: ... # example fields = weechat.infolist_fields(infolist) @@ -16147,7 +16150,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.infolist_integer(infolist, var) +def infolist_integer(infolist: str, var: str) -> int: ... # example weechat.prnt("", "integer = %d" % weechat.infolist_integer(infolist, "my_integer")) @@ -16186,7 +16189,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.infolist_string(infolist, var) +def infolist_string(infolist: str, var: str) -> str: ... # example weechat.prnt("", "string = %s" % weechat.infolist_string(infolist, "my_string")) @@ -16225,7 +16228,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.infolist_pointer(infolist, var) +def infolist_pointer(infolist: str, var: str) -> str: ... # example weechat.prnt("", "pointer = 0x%s" % weechat.infolist_pointer(infolist, "my_pointer")) @@ -16299,7 +16302,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.infolist_time(infolist, var) +def infolist_time(infolist: str, var: str) -> int: ... # example weechat.prnt("", "time = %ld" % weechat.infolist_time(infolist, "my_time")) @@ -16332,7 +16335,7 @@ Script (Python): [source,python] ---- # prototype -weechat.infolist_free(infolist) +def infolist_free(infolist: str) -> int: ... # example weechat.infolist_free(infolist) @@ -16601,7 +16604,7 @@ Script (Python): [source,python] ---- # prototype -hdata = weechat.hdata_get(hdata_name) +def hdata_get(hdata_name: str) -> str: ... # example hdata = weechat.hdata_get("irc_server") @@ -16641,7 +16644,7 @@ Script (Python): [source,python] ---- # prototype -offset = weechat.hdata_get_var_offset(hdata, name) +def hdata_get_var_offset(hdata: str, name: str) -> int: ... # example offset = weechat.hdata_get_var_offset(hdata, "name") @@ -16746,7 +16749,7 @@ Script (Python): [source,python] ---- # prototype -type = weechat.hdata_get_var_type_string(hdata, name) +def hdata_get_var_type_string(hdata: str, name: str) -> str: ... # example weechat.prnt("", "type = %s" % weechat.hdata_get_var_type_string("name")) @@ -16787,7 +16790,7 @@ Script (Python): [source,python] ---- # prototype -array_size = weechat.hdata_get_var_array_size(hdata, pointer, name) +def hdata_get_var_array_size(hdata: str, pointer: str, name: str) -> int: ... # example array_size = weechat.hdata_get_var_array_size(hdata, pointer, "name") @@ -16830,7 +16833,7 @@ Script (Python): [source,python] ---- # prototype -array_size = weechat.hdata_get_var_array_size_string(hdata, pointer, name) +def hdata_get_var_array_size_string(hdata: str, pointer: str, name: str) -> str: ... # example array_size = weechat.hdata_get_var_array_size_string(hdata, pointer, "name") @@ -16870,7 +16873,7 @@ Script (Python): [source,python] ---- # prototype -hdata_name = weechat.hdata_get_var_hdata(hdata, name) +def hdata_get_var_hdata(hdata: str, name: str) -> str: ... # example weechat.prnt("", "hdata = %s" % weechat.hdata_get_var_hdata(hdata, "name")) @@ -16982,7 +16985,7 @@ Script (Python): [source,python] ---- # prototype -list = weechat.hdata_get_list(hdata, name) +def hdata_get_list(hdata: str, name: str) -> str: ... # example hdata = weechat.hdata_get("buffer") @@ -17038,7 +17041,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.hdata_check_pointer(hdata, list, pointer) +def hdata_check_pointer(hdata: str, list: str, pointer: str) -> int: ... # example hdata = weechat.hdata_get("buffer") @@ -17095,7 +17098,7 @@ Script (Python): [source,python] ---- # prototype -pointer = weechat.hdata_move(hdata, pointer, count) +def hdata_move(hdata: str, pointer: str, count: int) -> str: ... # example hdata = weechat.hdata_get("buffer") @@ -17158,7 +17161,7 @@ Script (Python): [source,python] ---- # prototype -pointer = weechat.hdata_search(hdata, pointer, search, count) +def hdata_search(hdata: str, pointer: str, search: str, count: int) -> str: ... # example hdata = weechat.hdata_get("irc_server") @@ -17206,7 +17209,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.hdata_char(hdata, pointer, name) +def hdata_char(hdata: str, pointer: str, name: str) -> int: ... # example weechat.prnt("", "letter = %c" % weechat.hdata_char(hdata, pointer, "letter")) @@ -17250,7 +17253,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.hdata_integer(hdata, pointer, name) +def hdata_integer(hdata: str, pointer: str, name: str) -> int: ... # example hdata = weechat.hdata_get("buffer") @@ -17294,7 +17297,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.hdata_long(hdata, pointer, name) +def hdata_long(hdata: str, pointer: str, name: str) -> int: ... # example weechat.prnt("", "longvar = %ld" % weechat.hdata_long(hdata, pointer, "longvar")) @@ -17338,7 +17341,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.hdata_string(hdata, pointer, name) +def hdata_string(hdata: str, pointer: str, name: str) -> str: ... # example hdata = weechat.hdata_get("buffer") @@ -17384,7 +17387,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.hdata_pointer(hdata, pointer, name) +def hdata_pointer(hdata: str, pointer: str, name: str) -> str: ... # example hdata = weechat.hdata_get("buffer") @@ -17446,7 +17449,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.hdata_time(hdata, pointer, name) +def hdata_time(hdata: str, pointer: str, name: str) -> int: ... # example buf = weechat.buffer_search_main() @@ -17500,7 +17503,7 @@ Script (Python): [source,python] ---- # prototype -hashtable = weechat.hdata_hashtable(hdata, pointer, name) +def hdata_hashtable(hdata: str, pointer: str, name: str) -> Dict[str, str]: ... # example hdata = weechat.hdata_get("buffer") @@ -17555,7 +17558,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.hdata_compare(hdata, pointer1, pointer2, name, case_sensitive) +def hdata_compare(hdata: str, pointer1: str, pointer2: str, name: str, case_sensitive: int) -> int: ... # example hdata = weechat.hdata_get("buffer") @@ -17678,7 +17681,7 @@ Script (Python): [source,python] ---- # prototype -count = weechat.hdata_update(hdata, pointer, hashtable) +def hdata_update(hdata: str, pointer: str, hashtable: Dict[str, str]) -> int: ... # example: subtract one hour on last message displayed in current buffer own_lines = weechat.hdata_pointer(weechat.hdata_get("buffer"), weechat.current_buffer(), "own_lines") @@ -17741,7 +17744,7 @@ Script (Python): [source,python] ---- # prototype -value = weechat.hdata_get_string(hdata, property) +def hdata_get_string(hdata: str, property: str) -> str: ... # example weechat.prnt("", "variables in hdata: %s" % weechat.hdata_get_string(hdata, "var_keys")) @@ -17811,7 +17814,7 @@ Script (Python): [source,python] ---- # prototype -upgrade_file = weechat.upgrade_new(filename, callback_read, callback_read_data) +def upgrade_new(filename: str, callback_read: str, callback_read_data: str) -> str: ... # example upgrade_file = weechat.upgrade_new("my_file", "", "") @@ -17859,7 +17862,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.upgrade_write_object(upgrade_file, object_id, infolist) +def upgrade_write_object(upgrade_file: str, object_id: int, infolist: str) -> int: ... # example weechat.upgrade_write_object(upgrade_file, 1, infolist) @@ -17898,7 +17901,7 @@ Script (Python): [source,python] ---- # prototype -rc = weechat.upgrade_read(upgrade_file) +def upgrade_read(upgrade_file: str) -> int: ... # example weechat.upgrade_read(upgrade_file) @@ -17931,7 +17934,7 @@ Script (Python): [source,python] ---- # prototype -weechat.upgrade_close(upgrade_file) +def upgrade_close(upgrade_file: str) -> int: ... # example weechat.upgrade_close(upgrade_file) |