update examples in python API

This commit is contained in:
Emmanuel Bouthenot 2005-06-05 12:54:31 +00:00
parent 1de7b52aa2
commit 821c2e87c8
8 changed files with 210 additions and 248 deletions

View File

@ -1443,7 +1443,7 @@ List all Python scripts: @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( name, version, shutdown_function, description );}@*
@command{weechat.register ( name, version, shutdown_function, description )}@*
@*
This is first function to call in Python script.@*
All Python scripts for WeeChat should call this function.@*
@ -1459,11 +1459,11 @@ unloaded (optional parameter, empty string means nothing is called at the end)
@end itemize
@*
@emph{Example:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@*
@*
@item
@command{weechat.prnt ( message, [channel, [server]] );}@*
@command{weechat.prnt ( message, [channel, [server]] )}@*
@*
Print message in a channel.@*
@ -1475,13 +1475,13 @@ Print message in a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( delay, message );}@*
@command{weechat.print_infobar ( delay, message )}@*
@*
Print message in infobar.@*
@ -1493,11 +1493,11 @@ Print message in infobar.@*
@end itemize
@*
@emph{Example:}@*
@code{weechat.print_infobar (5, "message");}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( name, function );}@*
@command{weechat.add_message_handler ( name, function )}@*
@*
Attach a Python function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@ -1512,18 +1512,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ weechat.print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", my_function)}@*
@code{def my_function(server, args):}@*
@code{@ @ @ @ weechat.prnt("server="+server)}@*
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("host="+hostmask+", channel="+channel+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( name, function );}@*
@command{weechat.add_command_handler ( name, function )}@*
@*
Create new WeeChat command, linked with Python function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@ -1538,16 +1536,13 @@ available until your Python script will be unloaded.
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("command", my_command)}@*
@code{def my_command(server, args):}@*
@code{@ @ @ @ weechat.prnt("server:"+server+" arguments:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@ -1559,14 +1554,14 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( name, [server] );}@*
@command{weechat.get_info ( name, [server] )}@*
@*
Get various info about WeeChat, server or user.@*
@ -1585,8 +1580,8 @@ Get various info about WeeChat, server or user.@*
@end itemize
@*
@emph{Examples:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize

View File

@ -1445,7 +1445,7 @@ Listar los programas Python cargados: @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on )}@*
@*
Es la primera funci@'on a la que llamar en el programa Python.@*
Todos los programas en Python para WeeChat deben llamar esta funci@'on.@*
@ -1461,11 +1461,11 @@ tener un nombre distinto)
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...")}@*
@*
@item
@command{weechat.prnt ( mensaje, [canal, [servidor]] );}@*
@command{weechat.prnt ( mensaje, [canal, [servidor]] )}@*
@*
Escribe un mensaje en un canal.@*
@ -1477,29 +1477,29 @@ Escribe un mensaje en un canal.@*
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.prnt ("mensaje");}@*
@code{weechat.prnt ("mensaje", "#weechat");}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode");}@*
@code{weechat.prnt ("mensaje")}@*
@code{weechat.prnt ("mensaje", "#weechat")}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( retraso, mensaje );}@*
@command{weechat.print_infobar ( retraso, mensaje )}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{plazo}: periodo en segundo durante el cual se mostrar@'a el mensaje
@item @option{retraso}: periodo en segundo durante el cual se mostrar@'a el mensaje
(si es 0, el mensaje no se borrar@'a).
@item @option{message}: mensaje que se escribir@'a en la barra de informaciones.
@item @option{mensaje}: mensaje que se escribir@'a en la barra de informaciones.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.print_infobar (5, "mensaje");}@*
@code{weechat.print_infobar (5, "mensaje")}@*
@*
@item
@command{weechat.add_message_handler ( nombre, funci@'on );}@*
@command{weechat.add_message_handler ( nombre, funci@'on )}@*
@*
Adjunta una funci@'on Python a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@ -1515,18 +1515,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", mi_funcion)}@*
@code{def mi_funcion(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("servidor="+servidor)}@*
@code{@ @ @ @ null, canal, mensaje = string.split(args, ":", 2)}@*
@code{@ @ @ @ mascara, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("mascara="+mascara+", canal="+canal+", mensaje="+mensaje)}@*
@*
@item
@command{weechat.add_command_handler ( nombre, funci@'on );}@*
@command{weechat.add_command_handler ( nombre, funci@'on )}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Python.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@ -1541,16 +1539,13 @@ al antiguo comando si el script Python est@'a cargado.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("comando", mi_comando)}@*
@code{def mi_comando(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("Servidor:"+servidor+" Par@'ametros:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@ -1562,13 +1557,13 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nombre, [servidor] );}@*
@command{weechat.get_info ( nombre, [servidor] )}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@ -1587,8 +1582,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize

View File

@ -1444,7 +1444,7 @@ Lister les scripts Python charg@'es : @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( nom, version, fonction_de_fin, description );}@*
@command{weechat.register ( nom, version, fonction_de_fin, description )}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Python.@*
Tout script Python pour WeeChat doit appeler cette fonction.@*
@ -1461,11 +1461,11 @@ de fonction @`a appeler)
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !")}@*
@*
@item
@command{weechat.prnt ( message, [canal, [serveur]] );}@*
@command{weechat.prnt ( message, [canal, [serveur]] )}@*
@*
Affiche un message dans un canal.@*
@ -1477,13 +1477,13 @@ Affiche un message dans un canal.@*
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( d@'elai, message );}@*
@command{weechat.print_infobar ( d@'elai, message )}@*
@*
Affiche un message dans la barre d'infos.@*
@ -1495,11 +1495,11 @@ Affiche un message dans la barre d'infos.@*
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.print_infobar (5, "message");}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( nom, fonction );}@*
@command{weechat.add_message_handler ( nom, fonction )}@*
@*
Attache une fonction Python @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@ -1515,18 +1515,16 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", ma_fonction)}@*
@code{def ma_fonction(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur="+serveur)}@*
@code{@ @ @ @ null, canal, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ masque, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("masque="+masque+", canal="+canal+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( nom, fonction );}@*
@command{weechat.add_command_handler ( nom, fonction )}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Python.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@ -1541,16 +1539,13 @@ ne seront plus accessibles tant que le script Python sera charg@'e.
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("commande", ma_commande)}@*
@code{def ma_commande(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur:"+serveur+" param@`etres:"+args)}@*
@*
@item
@command{weechat.command ( commande, [canal, [serveur]] );}@*
@command{weechat.command ( commande, [canal, [serveur]] )}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@ -1562,13 +1557,13 @@ Ex@'ecute une commande ou envoie un message @'a un canal.@*
@end itemize
@*
@emph{Exemples :}@*
@code{weechat.command ("bonjour tout le monde !");}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("bonjour tout le monde !")}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nom, [serveur] );}@*
@command{weechat.get_info ( nom, [serveur] )}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@ -1587,8 +1582,8 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@end itemize
@*
@emph{Exemples :}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize

View File

@ -576,11 +576,11 @@ Todos os Scripts Python para o Weechat devem invocar esta fun@,{c}@~ao.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@*
@*
@item
@command{weechat.prnt ( mensagem, [canal, [servidor]] );}@*
@command{weechat.prnt ( mensagem, [canal, [servidor]] )}@*
@*
Imprimne uma mensagem na canal.@*
@ -592,13 +592,13 @@ Imprimne uma mensagem na canal.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.prnt ("mensagem");}@*
@code{weechat.prnt ("mensagem", "#weechat");}@*
@code{weechat.prnt ("mensagem", "#weechat", "freenode");}@*
@code{weechat.prnt ("mensagem")}@*
@code{weechat.prnt ("mensagem", "#weechat")}@*
@code{weechat.prnt ("mensagem", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( atrasa, mensagem );}@*
@command{weechat.print_infobar ( atrasa, mensagem )}@*
@*
Imprimne uma mensagem na barra do info.@*
@ -610,11 +610,11 @@ Imprimne uma mensagem na barra do info.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.print_infobar (5, "mensagem");}@*
@code{weechat.print_infobar (5, "mensagem")}@*
@*
@item
@command{weechat.add_message_handler ( nome, fun@,{c}@~ao );}@*
@command{weechat.add_message_handler ( nome, fun@,{c}@~ao )}@*
@*
Anexa uma fun@,{c}@~ao Python a uma mensagem de IRC.@*
A fun@,{c}@~ao ser@'a invocada de cada vez que a mensagem IRC for recebida.@*
@ -629,17 +629,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", my_function)}@*
@code{def my_function(server, args):}@*
@code{@ @ @ @ weechat.prnt("server="+server)}@*
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("host="+hostmask+", channel="+channel+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( nome, fun@,{c}@~ao );}@*
@command{weechat.add_command_handler ( nome, fun@,{c}@~ao )}@*
@*
Cria um novo comando do Weechat, ligado a uma fun@,{c}@~ao Python.@*
A fun@,{c}@~ao ser@'a chamada quando o utilizador a invocar utilizando @command{/nome}@*
@ -652,16 +651,13 @@ Este nome pode pertencer a um comando j
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Argumentos: ".@@_[0]);}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("command", my_command)}@*
@code{def my_command(server, args):}@*
@code{@ @ @ @ weechat.prnt("Servidor:"+server+" Argumentos:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@ -673,13 +669,13 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nome, [servidor] );}@*
@command{weechat.get_info ( nome, [servidor] )}@*
@*
Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@ -698,8 +694,8 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@end itemize
@*
@emph{Exemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize

View File

@ -1443,7 +1443,7 @@ List all Python scripts: @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( name, version, shutdown_function, description );}@*
@command{weechat.register ( name, version, shutdown_function, description )}@*
@*
This is first function to call in Python script.@*
All Python scripts for WeeChat should call this function.@*
@ -1459,11 +1459,11 @@ unloaded (optional parameter, empty string means nothing is called at the end)
@end itemize
@*
@emph{Example:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@*
@*
@item
@command{weechat.prnt ( message, [channel, [server]] );}@*
@command{weechat.prnt ( message, [channel, [server]] )}@*
@*
Print message in a channel.@*
@ -1475,13 +1475,13 @@ Print message in a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( delay, message );}@*
@command{weechat.print_infobar ( delay, message )}@*
@*
Print message in infobar.@*
@ -1493,11 +1493,11 @@ Print message in infobar.@*
@end itemize
@*
@emph{Example:}@*
@code{weechat.print_infobar (5, "message");}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( name, function );}@*
@command{weechat.add_message_handler ( name, function )}@*
@*
Attach a Python function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@ -1512,18 +1512,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ weechat.print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", my_function)}@*
@code{def my_function(server, args):}@*
@code{@ @ @ @ weechat.prnt("server="+server)}@*
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("host="+hostmask+", channel="+channel+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( name, function );}@*
@command{weechat.add_command_handler ( name, function )}@*
@*
Create new WeeChat command, linked with Python function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@ -1538,16 +1536,13 @@ available until your Python script will be unloaded.
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("command", my_command)}@*
@code{def my_command(server, args):}@*
@code{@ @ @ @ weechat.prnt("server:"+server+" arguments:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@ -1559,14 +1554,14 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( name, [server] );}@*
@command{weechat.get_info ( name, [server] )}@*
@*
Get various info about WeeChat, server or user.@*
@ -1585,8 +1580,8 @@ Get various info about WeeChat, server or user.@*
@end itemize
@*
@emph{Examples:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize

View File

@ -1445,7 +1445,7 @@ Listar los programas Python cargados: @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on )}@*
@*
Es la primera funci@'on a la que llamar en el programa Python.@*
Todos los programas en Python para WeeChat deben llamar esta funci@'on.@*
@ -1461,11 +1461,11 @@ tener un nombre distinto)
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...")}@*
@*
@item
@command{weechat.prnt ( mensaje, [canal, [servidor]] );}@*
@command{weechat.prnt ( mensaje, [canal, [servidor]] )}@*
@*
Escribe un mensaje en un canal.@*
@ -1477,29 +1477,29 @@ Escribe un mensaje en un canal.@*
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.prnt ("mensaje");}@*
@code{weechat.prnt ("mensaje", "#weechat");}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode");}@*
@code{weechat.prnt ("mensaje")}@*
@code{weechat.prnt ("mensaje", "#weechat")}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( retraso, mensaje );}@*
@command{weechat.print_infobar ( retraso, mensaje )}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{plazo}: periodo en segundo durante el cual se mostrar@'a el mensaje
@item @option{retraso}: periodo en segundo durante el cual se mostrar@'a el mensaje
(si es 0, el mensaje no se borrar@'a).
@item @option{message}: mensaje que se escribir@'a en la barra de informaciones.
@item @option{mensaje}: mensaje que se escribir@'a en la barra de informaciones.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.print_infobar (5, "mensaje");}@*
@code{weechat.print_infobar (5, "mensaje")}@*
@*
@item
@command{weechat.add_message_handler ( nombre, funci@'on );}@*
@command{weechat.add_message_handler ( nombre, funci@'on )}@*
@*
Adjunta una funci@'on Python a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@ -1515,18 +1515,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", mi_funcion)}@*
@code{def mi_funcion(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("servidor="+servidor)}@*
@code{@ @ @ @ null, canal, mensaje = string.split(args, ":", 2)}@*
@code{@ @ @ @ mascara, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("mascara="+mascara+", canal="+canal+", mensaje="+mensaje)}@*
@*
@item
@command{weechat.add_command_handler ( nombre, funci@'on );}@*
@command{weechat.add_command_handler ( nombre, funci@'on )}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Python.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@ -1541,16 +1539,13 @@ al antiguo comando si el script Python est@'a cargado.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("comando", mi_comando)}@*
@code{def mi_comando(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("Servidor:"+servidor+" Par@'ametros:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@ -1562,13 +1557,13 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nombre, [servidor] );}@*
@command{weechat.get_info ( nombre, [servidor] )}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@ -1587,8 +1582,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize

View File

@ -1444,7 +1444,7 @@ Lister les scripts Python charg@'es : @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( nom, version, fonction_de_fin, description );}@*
@command{weechat.register ( nom, version, fonction_de_fin, description )}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Python.@*
Tout script Python pour WeeChat doit appeler cette fonction.@*
@ -1461,11 +1461,11 @@ de fonction @`a appeler)
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !")}@*
@*
@item
@command{weechat.prnt ( message, [canal, [serveur]] );}@*
@command{weechat.prnt ( message, [canal, [serveur]] )}@*
@*
Affiche un message dans un canal.@*
@ -1477,13 +1477,13 @@ Affiche un message dans un canal.@*
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( d@'elai, message );}@*
@command{weechat.print_infobar ( d@'elai, message )}@*
@*
Affiche un message dans la barre d'infos.@*
@ -1495,11 +1495,11 @@ Affiche un message dans la barre d'infos.@*
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.print_infobar (5, "message");}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( nom, fonction );}@*
@command{weechat.add_message_handler ( nom, fonction )}@*
@*
Attache une fonction Python @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@ -1515,18 +1515,16 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", ma_fonction)}@*
@code{def ma_fonction(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur="+serveur)}@*
@code{@ @ @ @ null, canal, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ masque, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("masque="+masque+", canal="+canal+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( nom, fonction );}@*
@command{weechat.add_command_handler ( nom, fonction )}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Python.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@ -1541,16 +1539,13 @@ ne seront plus accessibles tant que le script Python sera charg@'e.
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("commande", ma_commande)}@*
@code{def ma_commande(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur:"+serveur+" param@`etres:"+args)}@*
@*
@item
@command{weechat.command ( commande, [canal, [serveur]] );}@*
@command{weechat.command ( commande, [canal, [serveur]] )}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@ -1562,13 +1557,13 @@ Ex@'ecute une commande ou envoie un message @'a un canal.@*
@end itemize
@*
@emph{Exemples :}@*
@code{weechat.command ("bonjour tout le monde !");}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("bonjour tout le monde !")}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nom, [serveur] );}@*
@command{weechat.get_info ( nom, [serveur] )}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@ -1587,8 +1582,8 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@end itemize
@*
@emph{Exemples :}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize

View File

@ -576,11 +576,11 @@ Todos os Scripts Python para o Weechat devem invocar esta fun@,{c}@~ao.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@*
@*
@item
@command{weechat.prnt ( mensagem, [canal, [servidor]] );}@*
@command{weechat.prnt ( mensagem, [canal, [servidor]] )}@*
@*
Imprimne uma mensagem na canal.@*
@ -592,13 +592,13 @@ Imprimne uma mensagem na canal.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.prnt ("mensagem");}@*
@code{weechat.prnt ("mensagem", "#weechat");}@*
@code{weechat.prnt ("mensagem", "#weechat", "freenode");}@*
@code{weechat.prnt ("mensagem")}@*
@code{weechat.prnt ("mensagem", "#weechat")}@*
@code{weechat.prnt ("mensagem", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( atrasa, mensagem );}@*
@command{weechat.print_infobar ( atrasa, mensagem )}@*
@*
Imprimne uma mensagem na barra do info.@*
@ -610,11 +610,11 @@ Imprimne uma mensagem na barra do info.@*
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.print_infobar (5, "mensagem");}@*
@code{weechat.print_infobar (5, "mensagem")}@*
@*
@item
@command{weechat.add_message_handler ( nome, fun@,{c}@~ao );}@*
@command{weechat.add_message_handler ( nome, fun@,{c}@~ao )}@*
@*
Anexa uma fun@,{c}@~ao Python a uma mensagem de IRC.@*
A fun@,{c}@~ao ser@'a invocada de cada vez que a mensagem IRC for recebida.@*
@ -629,17 +629,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", my_function)}@*
@code{def my_function(server, args):}@*
@code{@ @ @ @ weechat.prnt("server="+server)}@*
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("host="+hostmask+", channel="+channel+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( nome, fun@,{c}@~ao );}@*
@command{weechat.add_command_handler ( nome, fun@,{c}@~ao )}@*
@*
Cria um novo comando do Weechat, ligado a uma fun@,{c}@~ao Python.@*
A fun@,{c}@~ao ser@'a chamada quando o utilizador a invocar utilizando @command{/nome}@*
@ -652,16 +651,13 @@ Este nome pode pertencer a um comando j
@end itemize
@*
@emph{Exemplo:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Argumentos: ".@@_[0]);}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("command", my_command)}@*
@code{def my_command(server, args):}@*
@code{@ @ @ @ weechat.prnt("Servidor:"+server+" Argumentos:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@ -673,13 +669,13 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nome, [servidor] );}@*
@command{weechat.get_info ( nome, [servidor] )}@*
@*
Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@ -698,8 +694,8 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@end itemize
@*
@emph{Exemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize