mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 19:23:13 +02:00
api: add function string_format_size in scripting API
This commit is contained in:
@@ -443,6 +443,7 @@ Liste der Skript API Funktionen:
|
||||
string_has_highlight +
|
||||
string_has_highlight_regex +
|
||||
string_mask_to_regex +
|
||||
string_format_size +
|
||||
string_remove_color +
|
||||
string_is_command_char +
|
||||
string_input_for_buffer +
|
||||
|
||||
@@ -1718,8 +1718,16 @@ char *str = weechat_string_format_size (2097152); /* str == "2.10 MB" */
|
||||
free (str);
|
||||
----
|
||||
|
||||
[NOTE]
|
||||
This function is not available in scripting API.
|
||||
Script (Python):
|
||||
|
||||
[source,python]
|
||||
----
|
||||
# prototype
|
||||
str = weechat.string_format_size(size)
|
||||
|
||||
# example
|
||||
str = weechat.string_format_size(15200) # == "15.2 KB"
|
||||
----
|
||||
|
||||
==== string_remove_color
|
||||
|
||||
|
||||
@@ -430,6 +430,7 @@ List of functions in script API:
|
||||
string_has_highlight +
|
||||
string_has_highlight_regex +
|
||||
string_mask_to_regex +
|
||||
string_format_size +
|
||||
string_remove_color +
|
||||
string_is_command_char +
|
||||
string_input_for_buffer +
|
||||
|
||||
@@ -1751,8 +1751,16 @@ char *str = weechat_string_format_size (2097152); /* str == "2.10 Mo" */
|
||||
free (str);
|
||||
----
|
||||
|
||||
[NOTE]
|
||||
Cette fonction n'est pas disponible dans l'API script.
|
||||
Script (Python) :
|
||||
|
||||
[source,python]
|
||||
----
|
||||
# prototype
|
||||
str = weechat.string_format_size(size)
|
||||
|
||||
# exemple
|
||||
str = weechat.string_format_size(15200) # == "15.2 Ko"
|
||||
----
|
||||
|
||||
==== string_remove_color
|
||||
|
||||
|
||||
@@ -442,6 +442,7 @@ Liste des fonctions de l'API script :
|
||||
string_has_highlight +
|
||||
string_has_highlight_regex +
|
||||
string_mask_to_regex +
|
||||
string_format_size +
|
||||
string_remove_color +
|
||||
string_is_command_char +
|
||||
string_input_for_buffer +
|
||||
|
||||
@@ -1790,6 +1790,17 @@ char *str = weechat_string_format_size (2097152); /* str == "2.10 MB" */
|
||||
free (str);
|
||||
----
|
||||
|
||||
Script (Python):
|
||||
|
||||
[source,python]
|
||||
----
|
||||
# prototipo
|
||||
str = weechat.string_format_size(size)
|
||||
|
||||
# esempio
|
||||
str = weechat.string_format_size(15200) # == "15.2 KB"
|
||||
----
|
||||
|
||||
==== string_remove_color
|
||||
|
||||
Rimuove i colori di WeeChat da una stringa.
|
||||
|
||||
@@ -447,6 +447,7 @@ Elenco di funzioni nelle API per gli script:
|
||||
string_has_highlight +
|
||||
string_has_highlight_regex +
|
||||
string_mask_to_regex +
|
||||
string_format_size +
|
||||
string_remove_color +
|
||||
string_is_command_char +
|
||||
string_input_for_buffer +
|
||||
|
||||
@@ -1724,8 +1724,16 @@ char *str = weechat_string_format_size (2097152); /* str == "2.10 MB" */
|
||||
free (str);
|
||||
----
|
||||
|
||||
[NOTE]
|
||||
スクリプト API ではこの関数を利用できません。
|
||||
スクリプト (Python) での使用例:
|
||||
|
||||
[source,python]
|
||||
----
|
||||
# プロトタイプ
|
||||
str = weechat.string_format_size(size)
|
||||
|
||||
# 例
|
||||
str = weechat.string_format_size(15200) # == "15.2 KB"
|
||||
----
|
||||
|
||||
==== string_remove_color
|
||||
|
||||
|
||||
@@ -438,6 +438,7 @@ link:weechat_plugin_api.ja.html[WeeChat プラグイン API リファレンス]
|
||||
string_has_highlight +
|
||||
string_has_highlight_regex +
|
||||
string_mask_to_regex +
|
||||
string_format_size +
|
||||
string_remove_color +
|
||||
string_is_command_char +
|
||||
string_input_for_buffer +
|
||||
|
||||
@@ -436,6 +436,7 @@ Lista funkcji w API skryptów:
|
||||
string_has_highlight +
|
||||
string_has_highlight_regex +
|
||||
string_mask_to_regex +
|
||||
string_format_size +
|
||||
string_remove_color +
|
||||
string_is_command_char +
|
||||
string_input_for_buffer +
|
||||
|
||||
Reference in New Issue
Block a user