1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 07:46:38 +02:00

python: add infolists "python_function" and "python_constant"

This commit is contained in:
Sébastien Helleu
2024-03-04 23:22:13 +01:00
parent 81599b88d4
commit 6c72d6f66d
15 changed files with 241 additions and 25 deletions
+11 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-17 10:07+0100\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -13485,6 +13485,16 @@ msgstr "%s%s: nemohu spustit globální interpreter"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: nemohu získat aktuální status interpretru"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "seznam konfiguračních možností"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "seznam konfiguračních možností"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: nemohu uvolnit interpreter"
+15 -11
View File
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-26 15:16+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -14895,6 +14895,16 @@ msgstr "%s%s: globaler Interpreter kann nicht gestartet werden"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: aktueller Status des Interpreters kann nicht feststellt werden"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "Auflistung der Einstellungen"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "Auflistung der Einstellungen"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: Interpreter kann nicht freigeben werden"
@@ -15463,15 +15473,12 @@ msgstr ""
"Sicherheitsgründen besser, aber langsamer zu berechnen. Diese Zahl sollte "
"nicht zu hoch sein, wenn Ihre CPU langsam ist"
#| msgid ""
#| "number of seconds to allow before and after the current time for salted "
#| "password in api protocol"
msgid ""
"number of seconds to allow before and after the current time for the hash of "
"time + password in api protocol"
msgstr ""
"Anzahl an Sekunden, die vor und nach der aktuellen Uhrzeit für den Hash"
" eingeplant werden sollen, Zeit + Passwort im API-Protokoll"
"Anzahl an Sekunden, die vor und nach der aktuellen Uhrzeit für den Hash "
"eingeplant werden sollen, Zeit + Passwort im API-Protokoll"
msgid ""
"file with TLS certificate and private key (for serving clients with TLS) "
@@ -16913,8 +16920,7 @@ msgstr "verwaltet Trigger, das Schweizer Armeemesser für WeeChat"
msgid ""
"list [-o|-ol|-i|-il] || listfull || listdefault || add|addoff|addreplace "
"<name> <hook> "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<"
"return_code>\" [\"<post_action>\"]]]]]] "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<return_code>\" [\"<post_action>\"]]]]]] "
"|| addinput [<hook>] || input|output|recreate <name> || set <name> <option> "
"<value> || rename|copy <name> <new_name> || enable|disable|toggle [<name>|"
"<mask> [<name>|<mask>...]] || restart <name>|<mask> [<name>|<mask>...] || "
@@ -16923,8 +16929,7 @@ msgid ""
msgstr ""
"list [-o|-ol|-i|-il] || listfull || listdefault || add|addoff|addreplace "
"<name> <hook> "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<"
"return_code>\" [\"<post_action>\"]]]]]] "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<return_code>\" [\"<post_action>\"]]]]]] "
"|| addinput [<hook>] || input|output|recreate <name> || set <name> <option> "
"<value> || rename|copy <name> <new_name> || enable|disable|toggle [<name>|"
"<mask> [<name>|<mask>...]] || restart <name>|<mask> [<name>|<mask>...] || "
@@ -17922,4 +17927,3 @@ msgstr "%s%s: Zeitüberschreitung für \"%s\" mit %s"
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr ""
"%s%s: Verbindung konnte nicht hergestellt werden: unerwarteter Fehler (%d)"
+11 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-17 10:07+0100\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -13800,6 +13800,16 @@ msgstr "%s%s: no es posible iniciar el intérprete global"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: no es posible obtener el estado del interprete actual"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "lista de opciones"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "lista de opciones"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: no es posible liberar el interprete"
+8 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"PO-Revision-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-03-05 19:56+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -14592,6 +14592,12 @@ msgstr "%s%s : impossible de lancer l'interpréteur global"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s : impossible de lire l'état courant de l'interpréteur"
msgid "list of scripting API functions"
msgstr "liste des fonctions de l'API script"
msgid "list of scripting API constants"
msgstr "liste des constantes de l'API script"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s : impossible de libérer l'interpréteur"
+9 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -12962,6 +12962,14 @@ msgstr "%s nem sikerült a szervert létrehozni\n"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s nem sikerült a szervert létrehozni\n"
#, fuzzy
msgid "list of scripting API functions"
msgstr "konfigurációs paraméterek beállítása"
#, fuzzy
msgid "list of scripting API constants"
msgstr "konfigurációs paraméterek beállítása"
#, fuzzy, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s nem sikerült a szervert létrehozni\n"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-17 10:07+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -13814,6 +13814,16 @@ msgstr "%s%s: impossibile avviare l'interprete globale"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: impossibile ricevere lo stato attuale dell'interprete"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "elenco delle opzioni"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "elenco delle opzioni"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: impossibile liberare l'interprete"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-17 10:07+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -14216,6 +14216,16 @@ msgstr "%s%s: グローバルインタプリタの起動に失敗"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: 現在のインタプリタの状態の取得に失敗"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "オプションリスト"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "オプションリスト"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: インタプリタの開放に失敗"
+11 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-17 10:07+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -14174,6 +14174,16 @@ msgstr "%s%s: nie można uruchomić globalnego interpretera"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: nie można pobrać obecnego stanu interpretera"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "lista opcji"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "lista opcji"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: nie można zwolnić interpretera"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-17 10:07+0100\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -14154,6 +14154,16 @@ msgstr "%s%s: não foi possível iniciar o interpretador global"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: não foi possível obter o estado atual do interpretador"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "lista de opções"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "lista de opções"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: não foi possível libertar o interpretador"
+11 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-17 10:07+0100\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -13349,6 +13349,16 @@ msgstr "%s%s: não foi possível executar interpretador global"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: não foi possível obter estado do interpretador atual"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "lista de opções"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "lista de opções"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: não foi possível liberar interpretador"
+9 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -13013,6 +13013,14 @@ msgstr "%s не могу создать сервер\n"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s не могу создать сервер\n"
#, fuzzy
msgid "list of scripting API functions"
msgstr "настроить параметры конфигурации"
#, fuzzy
msgid "list of scripting API constants"
msgstr "настроить параметры конфигурации"
#, fuzzy, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s не могу создать сервер\n"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-23 09:16+0400\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -14166,6 +14166,16 @@ msgstr "%s%s: није успело покретање глобалног инт
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: није успело добијање тренутног стања интерпретера"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "листа опција"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "листа опција"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: не може да се пронађе слободан интерпретер"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2024-02-17 10:08+0100\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -14369,6 +14369,16 @@ msgstr "%s%s: Global yorumlayıcı başlatılamıyor"
msgid "%s%s: unable to get current interpreter state"
msgstr "%s%s: Geçerli yorumlayıcı durumu alınamıyor"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API functions"
msgstr "seçeneklerin listesi"
#, fuzzy
#| msgid "list of options"
msgid "list of scripting API constants"
msgstr "seçeneklerin listesi"
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr "%s%s: yorumlayıcı serbest bırakılamıyor"
+7 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2024-02-26 12:54+0100\n"
"POT-Creation-Date: 2024-03-05 19:55+0100\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -11846,6 +11846,12 @@ msgstr ""
msgid "%s%s: unable to get current interpreter state"
msgstr ""
msgid "list of scripting API functions"
msgstr ""
msgid "list of scripting API constants"
msgstr ""
#, c-format
msgid "%s%s: unable to free interpreter"
msgstr ""
+94
View File
@@ -1292,6 +1292,83 @@ weechat_python_info_eval_cb (const void *pointer, void *data,
return output;
}
/*
* Returns infolist with list of functions in python scripting API.
*/
struct t_infolist *
weechat_python_infolist_functions ()
{
struct t_infolist *infolist;
struct t_infolist_item *item;
int i;
infolist = weechat_infolist_new ();
if (!infolist)
return NULL;
for (i = 0; weechat_python_funcs[i].ml_name; i++)
{
item = weechat_infolist_new_item (infolist);
if (!item)
{
weechat_infolist_free (infolist);
return NULL;
}
if (!weechat_infolist_new_var_string (item, "name", weechat_python_funcs[i].ml_name))
{
weechat_infolist_free (infolist);
return NULL;
}
}
return infolist;
}
/*
* Returns infolist with list of constants in python scripting API.
*/
struct t_infolist *
weechat_python_infolist_constants ()
{
struct t_infolist *infolist;
struct t_infolist_item *item;
int i;
infolist = weechat_infolist_new ();
if (!infolist)
goto error;
for (i = 0; weechat_script_constants[i].name; i++)
{
item = weechat_infolist_new_item (infolist);
if (!item)
goto error;
if (!weechat_infolist_new_var_string (item, "name", weechat_script_constants[i].name))
goto error;
if (weechat_script_constants[i].value_string)
{
if (!weechat_infolist_new_var_string (item, "type", "string"))
goto error;
if (!weechat_infolist_new_var_string (item, "value_string", weechat_script_constants[i].value_string))
goto error;
}
else
{
if (!weechat_infolist_new_var_string (item, "type", "integer"))
goto error;
if (!weechat_infolist_new_var_integer (item, "value_integer", weechat_script_constants[i].value_integer))
goto error;
}
}
return infolist;
error:
if (infolist)
weechat_infolist_free (infolist);
return NULL;
}
/*
* Returns infolist with python scripts.
*/
@@ -1316,6 +1393,12 @@ weechat_python_infolist_cb (const void *pointer, void *data,
arguments);
}
if (strcmp (infolist_name, "python_function") == 0)
return weechat_python_infolist_functions ();
if (strcmp (infolist_name, "python_constant") == 0)
return weechat_python_infolist_constants ();
return NULL;
}
@@ -1519,6 +1602,17 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
plugin_script_display_short_list (weechat_python_plugin,
python_scripts);
weechat_hook_infolist ("python_function",
N_("list of scripting API functions"),
"",
"",
&weechat_python_infolist_cb, NULL, NULL);
weechat_hook_infolist ("python_constant",
N_("list of scripting API constants"),
"",
"",
&weechat_python_infolist_cb, NULL, NULL);
/* init OK */
return WEECHAT_RC_OK;
}