doc: add link to weechat.org/info in scripting guide (URL transfer) and plugin API reference (function hook_process)

v2.8-utf8proc
Sebastien Helleu 2013-03-16 16:06:16 +01:00
parent 3fb123510a
commit e1e3109da3
9 changed files with 89 additions and 48 deletions

View File

@ -728,23 +728,28 @@ einen URL Transfer, kommt die Funktion `hook_process_hashtable` zum Einsatz.
Beispiel eines URL Transfers, ohne zusätzliche Optionen: Die HTML Seite wird
dabei in der Callback-Variable "out" gesichert (Standardausgabe des Prozesses):
// TRANSLATION MISSING
[source,python]
----------------------------------------
# Zeigt die Versionen der Linux-Kerne.
kernel_txt = ""
# Display current stable version of WeeChat.
weechat_version = ""
def kernel_process_cb(data, command, rc, out, err):
global kernel_txt
def weechat_process_cb(data, command, rc, out, err):
global weechat_version
if out != "":
kernel_txt += out
weechat_version += out
if int(rc) >= 0:
weechat.prnt("", kernel_txt)
weechat.prnt("", "Current WeeChat stable is: %s" % weechat_version)
return weechat.WEECHAT_RC_OK
weechat.hook_process("url:http://www.kernel.org/kdist/finger_banner",
30 * 1000, "kernel_process_cb", "")
weechat.hook_process("url:http://weechat.org/info/stable/",
30 * 1000, "weechat_process_cb", "")
----------------------------------------
// TRANSLATION MISSING
[TIP]
All infos available about WeeChat are on page http://weechat.org/info
Beispiel eines URL Transfers, mit zusätzliche Optionen: Es wird das neuste
WeeChat Entwicklerpaket in die Datei '/tmp/weechat-devel.tar.gz' gesichert:

View File

@ -6987,6 +6987,10 @@ The command can be an URL with format: "url:http://www.example.com", to download
content of URL (_new in version 0.3.7_). Options are possible for URL with
function <<_weechat_hook_process_hashtable,weechat_hook_process_hashtable>>.
[TIP]
If you want to retrieve infos about WeeChat (like current stable version,
latest git commit, ...), you can use URLs on page http://weechat.org/info
[NOTE]
Buffer size for sending data to callback is 64KB (there are 2 buffers: one for
stdout and one for stderr).

View File

@ -715,21 +715,24 @@ in callback (standard output of process):
[source,python]
----------------------------------------
# Display versions of Linux kernels.
kernel_txt = ""
# Display current stable version of WeeChat.
weechat_version = ""
def kernel_process_cb(data, command, rc, out, err):
global kernel_txt
def weechat_process_cb(data, command, rc, out, err):
global weechat_version
if out != "":
kernel_txt += out
weechat_version += out
if int(rc) >= 0:
weechat.prnt("", kernel_txt)
weechat.prnt("", "Current WeeChat stable is: %s" % weechat_version)
return weechat.WEECHAT_RC_OK
weechat.hook_process("url:http://www.kernel.org/kdist/finger_banner",
30 * 1000, "kernel_process_cb", "")
weechat.hook_process("url:http://weechat.org/info/stable/",
30 * 1000, "weechat_process_cb", "")
----------------------------------------
[TIP]
All infos available about WeeChat are on page http://weechat.org/info
Example of URL transfer with an option: download latest WeeChat development
package in file '/tmp/weechat-devel.tar.gz':

View File

@ -7088,6 +7088,11 @@ pour télécharger le contenu de l'URL (_nouveau dans la version 0.3.7_).
Des options pour l'URL sont possibles avec la fonction
<<_weechat_hook_process_hashtable,weechat_hook_process_hashtable>>.
[TIP]
Si vous souhaitez récupérer des infos à propos de WeeChat (comme la version
stable actuelle, le dernier commit git, etc...), vous pouvez utiliser les URLs
sur la page http://weechat.org/info
[NOTE]
La taille du tampon pour l'envoi des données au "callback" est de 64 Ko (il y a
2 tampons : un pour stdout et un pour stderr).

View File

@ -732,21 +732,25 @@ dans le "callback" (sortie standard du processus) :
[source,python]
----------------------------------------
# Afficher la version des noyaux Linux.
kernel_txt = ""
# Afficher la version stable courante de WeeChat.
weechat_version = ""
def kernel_process_cb(data, command, rc, out, err):
global kernel_txt
def weechat_process_cb(data, command, rc, out, err):
global weechat_version
if out != "":
kernel_txt += out
weechat_version += out
if int(rc) >= 0:
weechat.prnt("", kernel_txt)
weechat.prnt("", "La version stable courante de WeeChat est : %s" % weechat_version)
return weechat.WEECHAT_RC_OK
weechat.hook_process("url:http://www.kernel.org/kdist/finger_banner",
30 * 1000, "kernel_process_cb", "")
weechat.hook_process("url:http://weechat.org/info/stable/",
30 * 1000, "weechat_process_cb", "")
----------------------------------------
[TIP]
Toutes les infos disponibles à propos de WeeChat sont sur la page
http://weechat.org/info
Exemple de transfert d'URL avec une option : télécharger le dernier paquet de
développement WeeChat dans le fichier '/tmp/weechat-devel.tar.gz' :

View File

@ -7022,6 +7022,11 @@ scaricare il contenuto dell'URL (_novità nella versione 0.3.7_). Le opzioni per
un URL sono disponibili con la funzione
<<_weechat_hook_process_hashtable,weechat_hook_process_hashtable>>.
// TRANSLATION MISSING
[TIP]
If you want to retrieve infos about WeeChat (like current stable version,
latest git commit, ...), you can use URLs on page http://weechat.org/info
[NOTE]
La dimensione del buffer per l'invio dei dati alla callback è di 64KB (ci sono
2 buffer: uno per stdout ed uno per stderr).

View File

@ -732,23 +732,28 @@ delle opzioni per il trasferimento dell'URL.
Esempio di trasferimento di un URL senza opzioni: la pagina HTML verrà
ricevuta come "out" nella callback (output standard di un processo):
// TRANSLATION MISSING
[source,python]
----------------------------------------
# Visualizza le versioni dei kernel di Linux.
kernel_txt = ""
# Display current stable version of WeeChat.
weechat_version = ""
def kernel_process_cb(data, command, rc, out, err):
global kernel_txt
def weechat_process_cb(data, command, rc, out, err):
global weechat_version
if out != "":
kernel_txt += out
weechat_version += out
if int(rc) >= 0:
weechat.prnt("", kernel_txt)
weechat.prnt("", "Current WeeChat stable is: %s" % weechat_version)
return weechat.WEECHAT_RC_OK
weechat.hook_process("url:http://www.kernel.org/kdist/finger_banner",
30 * 1000, "kernel_process_cb", "")
weechat.hook_process("url:http://weechat.org/info/stable/",
30 * 1000, "weechat_process_cb", "")
----------------------------------------
// TRANSLATION MISSING
[TIP]
All infos available about WeeChat are on page http://weechat.org/info
Esempio di trasferimento di un URL con un'opzione: scaricare l'ultimo pacchetto
di sviluppo di WeeChat nel file '/tmp/weechat-devel.tar.gz':

View File

@ -691,23 +691,28 @@ URL をダウンロードする (又は URL にポストする) には、関数
オプション無しの URL 転送の例: HTML ページの内容はコールバックの
"out" 引数 (プロセスの標準出力) を通して渡されます。
// TRANSLATION MISSING
[source,python]
----------------------------------------
# Linux カーネルのバージョンを表示
kernel_txt = ""
# Display current stable version of WeeChat.
weechat_version = ""
def kernel_process_cb(data, command, rc, out, err):
global kernel_txt
def weechat_process_cb(data, command, rc, out, err):
global weechat_version
if out != "":
kernel_txt += out
weechat_version += out
if int(rc) >= 0:
weechat.prnt("", kernel_txt)
weechat.prnt("", "Current WeeChat stable is: %s" % weechat_version)
return weechat.WEECHAT_RC_OK
weechat.hook_process("url:http://www.kernel.org/kdist/finger_banner",
30 * 1000, "kernel_process_cb", "")
weechat.hook_process("url:http://weechat.org/info/stable/",
30 * 1000, "weechat_process_cb", "")
----------------------------------------
// TRANSLATION MISSING
[TIP]
All infos available about WeeChat are on page http://weechat.org/info
オプション有りの URL 転送の例: 最新の WeeChat 開発パッケージをファイル
'/tmp/weechat-devel.tar.gz' にダウンロード:

View File

@ -715,23 +715,28 @@ Aby pobrać URL (albo wysłać do URL), należy użyć funkcji `hook_process`, l
Przykład transferu URL bez opcji: strona HTML jest otrzymywana jako "out"
(standardowe wyjście procesu):
// TRANSLATION MISSING
[source,python]
----------------------------------------
# Wyświetla wersje Linuksowych kerneli.
kernel_txt = ""
# Display current stable version of WeeChat.
weechat_version = ""
def kernel_process_cb(data, command, rc, out, err):
global kernel_txt
def weechat_process_cb(data, command, rc, out, err):
global weechat_version
if out != "":
kernel_txt += out
weechat_version += out
if int(rc) >= 0:
weechat.prnt("", kernel_txt)
weechat.prnt("", "Current WeeChat stable is: %s" % weechat_version)
return weechat.WEECHAT_RC_OK
weechat.hook_process("url:http://www.kernel.org/kdist/finger_banner",
30 * 1000, "kernel_process_cb", "")
weechat.hook_process("url:http://weechat.org/info/stable/",
30 * 1000, "weechat_process_cb", "")
----------------------------------------
// TRANSLATION MISSING
[TIP]
All infos available about WeeChat are on page http://weechat.org/info
Przykładowy transfer URL z opcją: pobranie najnowszej wersji rozwojowej WeeChat
do pliku '/tmp/weechat-devel.tar.gz':