summaryrefslogtreecommitdiff
path: root/src/plugins/python/weechat.pyi
AgeCommit message (Collapse)Author
2023-08-29api: add support of path to variable and hashtable comparison in function ↵Sébastien Helleu
hdata_compare (closes #1066)
2023-08-24Add compatibility with Python < 3.10 in weechat.pyiTrygve Aaberge
The | syntax for unions is only supported in Python 3.10 and later. Since Python 3.8 and 3.9 are still supported upstream for a while and we had a user reporting on IRC that they couldn't use the stub file since they are using 3.8, change to the old syntax for unions to support this. There aren't really any drawbacks of this. It's just a bit more verbose, and a typing import is necessary, but neither of those really matters in a generated stub file.
2023-07-08core: add option type "enum" (closes #1973)Sébastien Helleu
The type "enum" replaces type "integer" when used with string values. For compatibility, any option created with type "integer" and string values is automatically created to "enum" on creation, with no error.
2023-06-05doc: fix URLs to WeeChat docsSébastien Helleu
2023-03-16core: add configuration version, add API function config_set_versionSébastien Helleu
2023-01-28core: make function gui_buffer_match_list case sensitive (issue #1872)Sébastien Helleu
2022-12-11doc/api: Improve python example for config_new_sectionTrygve Aaberge
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.
2022-12-11scripts: Send null values to config section callbacksTrygve Aaberge
The callback_read and callback_create_option functions in the scripting APIs always get the value as a string, never as null. This means that if the value is null, there is no way for the script to distinguish this from an empty string for string options. This makes it impossible to properly make options with fallback values, like the irc server and server_default options, as far as I can see. All the scripting languages except Tcl use that language's equivalent for null. For JavaScript which has both null and undefined, null is used. For Tcl, the magic null string defined in commit 197a7a01e is used and the documentation is updated to describe that. I tested this with these scripts: https://gist.github.com/trygveaa/2d49c609addf9773d2ed16e15d1e3447 You can load all of those scripts and see the result with this command (assuming you have the scripts in the current directory): weechat -t -r "/filter add script * * script; /script load $(echo script_config.*)"
2022-10-14python: Fix return types for config option callbacksTrygve Aaberge
I erroneously typed the return types for these to int in commit e0c117e14, but they should be None.
2022-10-09python: Include script examples in function docstringTrygve Aaberge
This makes it possible to see how functions are used without having to go to the web page. It's especially useful to see the types of the callback functions.
2022-10-02python: Include constant values in python stubTrygve Aaberge
This is useful for two reasons: 1. When running unit tests for a script weechat needs to be mocked. By having the constant values available in the stub file, they can be loaded from that, instead of having to define the constants manually for the mock. 2. If you log a constant value you have to look up what it means. This makes it easier, in the same vein as PR #1824.
2022-09-27api: add function string_parse_sizeSébastien Helleu
2022-06-18doc: add trailing slashes in URLsSébastien Helleu
2022-03-17core: Fix regex for constants in the Python stub generatorTrygve Aaberge
In Python raw strings, newlines can't be escaped with a backslash. If you do that, both the backslash and the newline become part of the string. This meant that the regex for constants both started and ended with a newline which caused every other constant to be skipped.
2022-03-13python: add function buffer_new_props in Python stub fileSébastien Helleu
2022-03-12scripts: allow null values in config_new_optionTrygve Aaberge
The plugin API function config_new_option accepts null as the default_value and/or value however the scripting APIs (except for lua) didn't allow sending null as a parameter value, so it was impossible to use it this way. This allows sending a null value for these parameters. Lua already supported sending in nil for these parameters and it works as expected, so nothing is changed for this plugin. For Guile you can now send in #nil, for JavaScript null or undefined, for Perl undef, for PHP NULL, for Python None, for Ruby nil and for Tcl $::weechat::WEECHAT_NULL. In all of these languages except Tcl this is the special value indicating a missing value. However Tcl only has one type, string, so it doesn't have a null value. Therefore I created a constant with the value `\uFFFF\uFFFF\uFFFFWEECHAT_NULL\uFFFF\uFFFF\uFFFF` which is used instead. This is very unlikely to appear unintentionally. Using the unicode code point \uFFFF was suggested on https://wiki.tcl-lang.org/page/null. I tested this with these scripts: https://gist.github.com/trygveaa/f91977dde5d2876d502bf55fbf9b50cc
2022-02-20doc/api: Add missing parameter to python prototype for config_new_sectionTrygve Aaberge
2022-02-14doc/api: add missing type for argument "count" in Python prototype of ↵Sébastien Helleu
function ngettext
2022-01-30core: add support of date and tags in messages displayed in buffers with ↵Sébastien Helleu
free content, add function printf_y_date_tags (closes #1746)
2022-01-30doc/api: fix type of parameter "date" in script prototype of function ↵Sébastien Helleu
prnt_date_tags
2021-11-06api: add parameters pointers, extra_vars and options in function hdata_searchSébastien Helleu
2021-05-14core: add generator and Python stub file for WeeChat API (issue #1377)Sébastien Helleu