diff options
Diffstat (limited to 'doc/it/weechat_plugin_api.it.txt')
-rw-r--r-- | doc/it/weechat_plugin_api.it.txt | 69 |
1 files changed, 59 insertions, 10 deletions
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index 2364339ab..ea810640b 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -7090,10 +7090,29 @@ Gli argomenti sono gli stessi della funzione nella funzione, per cui è possibile liberarla dopo questa chiamata // TRANSLATION MISSING -For a standard command (not beginning with "url:"), the hashtable 'options' can -contain arguments for command (and then 'command' must be only the command -without arguments) _(WeeChat ≥ 0.4.0)_. + -The keys in hashtable must be: 'arg1', 'arg2', ... +For a standard command (not beginning with "url:"), following options are +available: + +// TRANSLATION MISSING +[width="100%",cols="^1,1,3",options="header"] +|=== +| Option | Value | Description + +// TRANSLATION MISSING +| argN (N ≥ 1) + + _(WeeChat ≥ 0.4.0)_ | + any string | + Arguments for command; if no argument is given with these options, + the command is automatically split like the shell does (and then command + arguments are read in the 'command' argument) + +// TRANSLATION MISSING +| stdin + + _(WeeChat ≥ 0.4.3)_ | + (not used) | + Create a pipe for writing data on standard input (stdin) of child process + (see function <<_weechat_hook_set,weechat_hook_set>>) +|=== Per il comando "url:..." sono disponibili le seguenti opzioni (consultare `man curl_easy_setopt` per la descrizione di ogni opzione): @@ -9624,7 +9643,7 @@ hook = weechat.hook_focus("buffer_nicklist", "my_focus_nicklist_cb", "") ==== weechat_hook_set -_WeeChat ≥ 0.3.9._ +_WeeChat ≥ 0.3.9 (script: WeeChat ≥ 0.4.3)._ // TRANSLATION MISSING Set string value of a hook property. @@ -9648,14 +9667,29 @@ Argomenti: // TRANSLATION MISSING Properties: -[width="100%",cols="^2,4,8",options="header"] +// TRANSLATION MISSING +[width="100%",cols="^2,2,2,5",options="header"] |=== -| Nome | Valore | Descrizione +| Nome | Hook type | Valore | Descrizione -| subplugin | qualsiasi stringa | +// TRANSLATION MISSING +| subplugin | any type | qualsiasi stringa | // TRANSLATION MISSING Name of sub plugin (commonly script name, which is displayed in `/help command` for a hook of type 'command') + +| stdin + + _(WeeChat ≥ 0.4.3)_ | + 'process', 'process_hashtable' | qualsiasi stringa | +// TRANSLATION MISSING + Send data on standard input ('stdin') of child process + +| stdin_close + + _(WeeChat ≥ 0.4.3)_ | +// TRANSLATION MISSING + 'process', 'process_hashtable' | (not used) | +// TRANSLATION MISSING + Close pipe used to send data on standard input ('stdin') of child process |=== Esempio in C: @@ -9669,8 +9703,23 @@ struct t_hook *my_command_hook = weechat_hook_set (my_command_hook, "subplugin", "test"); ---- -[NOTE] -Questa funzione non è disponibile nelle API per lo scripting. +Script (Python): + +[source,python] +---- +# prototipo +weechat.hook_set(hook, property, value) + +# esempio +def my_process_cb(data, command, return_code, out, err): + # ... + return weechat.WEECHAT_RC_OK + +hook = weechat.hook_process_hashtable("/path/to/command", { "stdin": "1" }, + 20000, "my_process_cb", "") +weechat.hook_set(hook, "stdin", "data sent to stdin of child process") +weechat.hook_set(hook, "stdin_close", "") # optional +---- ==== weechat_unhook |