diff --git a/doc/weechat_doc_en.texi b/doc/weechat_doc_en.texi index d7c25597a..1ea73053e 100644 --- a/doc/weechat_doc_en.texi +++ b/doc/weechat_doc_en.texi @@ -35,7 +35,7 @@ @title WeeChat - User guide @subtitle Fast, light and extensible IRC client -@subtitle Documentation for WeeChat v0.1.2-cvs - April, 30 2005 +@subtitle Documentation for WeeChat v0.1.2-cvs - May, 08 2005 @image{weechat_image} @@ -765,13 +765,20 @@ display help about commands@* @* command: name of a WeeChat or IRC command@* @* -@item perl [load filename] | [autoload] | [unload] +@item perl [load filename] | [autoload] | [reload] | [unload] @* list/load/unload Perl scripts@* @* filename: Perl script (file) to load@* Without argument, /perl command lists all loaded Perl scripts.@* @* +@item python [load filename] | [autoload] | [reload] | [unload] +@* +list/load/unload Python scripts@* +@* +filename: Python script (file) to load@* +Without argument, /python command lists all loaded Python scripts.@* +@* @item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername] @* list, add or remove servers@* @@ -995,11 +1002,12 @@ list nicknames on channels@* @* channel: channel name@* @* -@item nick nickname +@item nick [-all] nickname @* change current nickname@* @* -nickname: new nickname for current IRC server@* +-all: set new nickname for all connected servers@* +nickname: new nickname@* @* @item notice nickname text @* @@ -1266,7 +1274,7 @@ List all Perl scripts: @kbd{/perl}@* @itemize @bullet @item -@command{IRC::register ( name, version, shutdown_function, description );}@* +@command{weechat::register ( name, version, shutdown_function, description );}@* @* This is first function to call in Perl script.@* All Perl scripts for WeeChat should call this function.@* @@ -1282,42 +1290,29 @@ unloaded (optional parameter, empty string means nothing is called at the end) @end itemize @* @emph{Example:}@* -@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@* +@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@* @* @item -@command{IRC::print ( message );}@* -@* -Print message in current window (channel or server).@* - -@emph{Arguments:} -@itemize @minus -@item @option{message}: message to display -@end itemize -@* -@emph{Example:}@* -@code{IRC::print ("message");}@* -@* - -@item -@command{IRC::print_with_channel ( channel, [server,] message );}@* +@command{weechat::print ( message, [channel, [server]] );}@* @* Print message in a channel.@* @emph{Arguments:} @itemize @minus +@item @option{message}: message to display @item @option{channel}: name of channel @item @option{server}: internal name of server -@item @option{message}: message to display @end itemize @* @emph{Examples:}@* -@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@* -@code{IRC::print_with_channel ("#weechat", "message");}@* +@code{weechat::print ("message");}@* +@code{weechat::print ("message", "#weechat");}@* +@code{weechat::print ("message", "#weechat", "freenode");}@* @* @item -@command{IRC::print_infobar ( delay, message );}@* +@command{weechat::print_infobar ( delay, message );}@* @* Print message in infobar.@* @@ -1329,11 +1324,11 @@ Print message in infobar.@* @end itemize @* @emph{Example:}@* -@code{IRC::print_infobar (5, "message");}@* +@code{weechat::print_infobar (5, "message");}@* @* @item -@command{IRC::add_message_handler ( name, function );}@* +@command{weechat::add_message_handler ( name, function );}@* @* Attach a Perl function to an IRC message.@* Function will be called each time IRC message will be received.@* @@ -1348,18 +1343,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Example:}@* -@code{IRC::add_message_handler ("privmsg", my_function);}@* +@code{weechat::add_message_handler ("privmsg", my_function);}@* @code{sub my_function}@* @code{@{ }@* -@code{@ @ @ @ IRC::print ("server=$_[0]\n");}@* +@code{@ @ @ @ weechat::print ("server=$_[0]\n");}@* @code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@* @code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@* -@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* +@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* @code{@} }@* @* @item -@command{IRC::add_command_handler ( name, function );}@* +@command{weechat::add_command_handler ( name, function );}@* @* Create new WeeChat command, linked with Perl function.@* Function will be called when user will launch command with @kbd{/name}.@* @@ -1374,23 +1369,41 @@ available until your Perl script will be unloaded. @end itemize @* @emph{Example:}@* -@code{IRC::add_command_handler ("command", my_command);}@* +@code{weechat::add_command_handler ("command", my_command);}@* @code{sub my_command}@* @code{@{ }@* -@code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@* +@code{@ @ @ @ weechat::print("Server: $_[0], arguments: $_[1]\n");}@* @code{@ @ @ @ return 0;}@* @code{@} }@* @* @item -@command{IRC::get_info ( [server,] name );}@* +@command{weechat::command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat::get_info ( name, [server] );}@* @* Get various info about WeeChat, server or user.@* @emph{Arguments:} @itemize @minus -@item @option{server}: internal name of server @item @option{name}: name of info to retrieve: +@item @option{server}: internal name of server @itemize @minus @item @option{0 or version}: get WeeChat version @item @option{1 or nick}: get nickname @@ -1403,7 +1416,7 @@ Get various info about WeeChat, server or user.@* @* @emph{Examples:}@* @code{$version = get_info("version");}@* -@code{$nick = get_info("freenode", "nick");}@* +@code{$nick = get_info("nick", "freenode");}@* @* @end itemize @@ -1411,7 +1424,172 @@ Get various info about WeeChat, server or user.@* @node Python scripts, Ruby scripts, Perl scripts, Extensions @section Python scripts -Not developed! +@subsection Load/unload Python scripts + +Python scripts are loaded and unloaded with @command{/python} command. +(type @kbd{/help python} within WeeChat to get help about command).@* + +@emph{Examples:}@* +@itemize @bullet +@item +Load a Python script: @kbd{/python load /tmp/sample.py}@* +@item +Unload all Python scripts: @kbd{/python unload}@* +@item +List all Python scripts: @kbd{/python}@* +@end itemize + +@subsection WeeChat / Python API + +@itemize @bullet +@item +@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.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: unique name to identify script (each script must have +unique name) +@item @option{version}: script's version +@item @option{shutdown_function}: Python function called when script is +unloaded (optional parameter, empty string means nothing is called at the end) +@item @option{description}: short description of script. +@end itemize +@* +@emph{Example:}@* +@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@* +@* + +@item +@command{weechat.prnt ( message, [channel, [server]] );}@* +@* +Print message in a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{message}: message to display +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@end itemize +@* +@emph{Examples:}@* +@code{weechat.prnt ("message");}@* +@code{weechat.prnt ("message", "#weechat");}@* +@code{weechat.prnt ("message", "#weechat", "freenode");}@* +@* + +@item +@command{weechat.print_infobar ( delay, message );}@* +@* +Print message in infobar.@* + +@emph{Arguments:} +@itemize @minus +@item @option{delay}: after this delay (in seconds), message will be erased +(if 0, message will not be erased). +@item @option{message}: message to display +@end itemize +@* +@emph{Example:}@* +@code{weechat.print_infobar (5, "message");}@* +@* + +@item +@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.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: name of IRC message@* +To know list of IRC messages, please refer to RFC 1459 and/or 2812:@* +RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@* +RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} +@item @option{function}: Python function called when message is received +@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{@} }@* +@* + +@item +@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}.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: name of new command@* +This name may be existing command, so that the command is overrided by +Python function. Be careful when overriding WeeChat commands, they'll not be +available until your Python script will be unloaded. +@item @option{function}: Python function linked with command +@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{@} }@* +@* + +@item +@command{weechat.command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + + +@item +@command{weechat.get_info ( name, [server] );}@* +@* +Get various info about WeeChat, server or user.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: name of info to retrieve: +@item @option{server}: internal name of server +@itemize @minus +@item @option{0 or version}: get WeeChat version +@item @option{1 or nick}: get nickname +@item @option{2 or channel}: get channel name +@item @option{3 or server}: get server name +@item @option{4 or weechatdir}: get WeeChat home directory +@item @option{5 or away}: get away flag for server +@end itemize +@end itemize +@* +@emph{Examples:}@* +@code{$version = weechat.get_info("version");}@* +@code{$nick = weechat.get_info("nick", "freenode");}@* +@* + +@end itemize @node Ruby scripts, , Python scripts, Extensions @section Ruby scripts diff --git a/doc/weechat_doc_es.texi b/doc/weechat_doc_es.texi index d11940585..8fd2f6eab 100644 --- a/doc/weechat_doc_es.texi +++ b/doc/weechat_doc_es.texi @@ -35,7 +35,7 @@ @title WeeChat - Gui@'on de usuario. @subtitle Cliente IRC r@'apido, peque@~no y extensible -@subtitle Documentaci@'on para WeeChat v0.1.2 - 30 de abril de 2005 +@subtitle Documentaci@'on para WeeChat v0.1.2 - 08 de mayo de 2005 @image{weechat_image} @@ -755,9 +755,9 @@ nombre_del_servidor: nombre del servidor del que desconectarse@* @* @item debug dump @* -print debug messages@* +imprime mensajes de depuraci@'on@* @* -dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)@* +volcado: almacena un volcado de memoria en el archivo de registro de Weechat (se escribe el mismo volcado cuando Weechat se cuelga)@* @* @item help [comando] @* @@ -765,13 +765,20 @@ mostrar ayuda sobre los comandos@* @* comando: nombre de un comando de Weechat @'o de IRC@* @* -@item perl [load fichero] | [autoload] | [unload] +@item perl [load fichero] | [autoload] | [reload] | [unload] @* lista/carga/descarga de los Perl scripts@* @* fichero: Perl script (archivo) a cargar@* Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@* @* +@item python [load fichero] | [autoload] | [reload] | [unload] +@* +lista/carga/descarga de los Python scripts@* +@* +fichero: Python script (archivo) a cargar@* +Sin argumentos, el comando /python lista todos los Python scripts cargados.@* +@* @item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor] @* lista, a@~nade o elimina servidores@* @@ -836,10 +843,10 @@ mensaje: mensaje para el estado ausente (si no se da ning @* @item ban [canal] [usariio [usuario ...]] @* -bans nicks or hosts@* +banea usuarios o m@'aquinas@* @* -channel: channel for ban@* -nickname: user or host to ban@* +canal: canal en el que banear@* +usuario: nombre de usuario o m@'aquina a banear@* @* @item ctcp usuario tipo @* @@ -912,11 +919,11 @@ comentario: comentario para la expulsi@'on@* @* @item kickban [canal] usuario [comentario] @* -kicks and bans a nick from a channel@* +expulsa y banea a un usuario de un canal@* @* -channel: channel where user is@* -nickname: nickname to kick and ban@* -comment: comment for kick@* +canal: canal donde est@'a el usuario@* +usuario: nombre de usuario a expulsar y banear@* +comentario: comentario para la expulsi@'on@* @* @item kill usuario comentario @* @@ -995,11 +1002,12 @@ listar usuarios en canales@* @* canal: nombre del canal@* @* -@item nick usuario +@item nick [-all] usuarios @* cambiar el nombre de usuario actual@* @* -usuario: nuevo nombre de usuario para el servidor IRC actual@* +-all: set new nickname for all connected servers@* +nickname: new nickname@* @* @item notice usuario texto @* @@ -1130,10 +1138,10 @@ target: servidor objetivo@* @* @item unban [canal] usuario [usuario ...] @* -unbans nicks or hosts@* +desbanea usuarios o m@'aquinas@* @* -channel: channel for unban@* -nickname: user or host to unban@* +canal: canal en el que desbanear (quitar la prohibici@'on)@* +usuario: usuario o m@'aquina a desbanear@* @* @item userhost usuario [usuario ...] @* @@ -1268,7 +1276,7 @@ Listar los programas Perl cargados: @kbd{/perl}@* @itemize @bullet @item -@command{IRC::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 Perl.@* Todos los programas en Perl para WeeChat deben llamar esta funci@'on.@* @@ -1284,42 +1292,29 @@ tener un nombre distinto) @end itemize @* @emph{Ejemplo:}@* -@code{IRC::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@* +@code{weechat::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@* @* @item -@command{IRC::print ( mensaje );}@* -@* -Escribe un mensaje en la ventana actual (canal o servidor).@* - -@emph{Par@'ametros:} -@itemize @minus -@item @option{mensaje}: mensaje a escribir -@end itemize -@* -@emph{Ejemplo:}@* -@code{IRC::print ("mensaje");}@* -@* - -@item -@command{IRC::print_with_channel ( canal, [servidor,] mensaje );}@* +@command{weechat::print ( mensaje, [canal, [servidor]] );}@* @* Escribe un mensaje en un canal.@* @emph{Par@'ametros:} @itemize @minus +@item @option{mensaje}: mensaje a escribir @item @option{canal}: nombre del canal @item @option{servidor}: (opcional) nombre interno del servidor -@item @option{mensaje}: mensaje que debe escribir en el canal @end itemize @* -@emph{Ejemplos:}@* -@code{IRC::print_with_channel ("#weechat", "freenode", "mensaje");}@* -@code{IRC::print_with_channel ("#weechat", "mensaje");}@* +@emph{Ejemplo:}@* +@code{weechat::print ("mensaje");}@* +@code{weechat::print ("mensaje", "#weechat");}@* +@code{weechat::print ("mensaje", "#weechat", "freenode");}@* @* @item -@command{IRC::print_infobar ( retraso, mensaje );}@* +@command{weechat::print_infobar ( retraso, mensaje );}@* @* Escribir un mensaje en la barra de informaciones.@* @@ -1331,11 +1326,11 @@ Escribir un mensaje en la barra de informaciones.@* @end itemize @* @emph{Ejemplo:}@* -@code{IRC::print_infobar (5, "mensaje");}@* +@code{weechat::print_infobar (5, "mensaje");}@* @* @item -@command{IRC::add_message_handler ( nombre, funci@'on );}@* +@command{weechat::add_message_handler ( nombre, funci@'on );}@* @* Adjunta una funci@'on Perl a un mensaje IRC.@* Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@* @@ -1351,18 +1346,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Ejemplo:}@* -@code{IRC::add_message_handler ("privmsg", mi_funcion);}@* +@code{weechat::add_message_handler ("privmsg", mi_funcion);}@* @code{sub mi_funcion}@* @code{@{ }@* -@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@* +@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@* @code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@* @code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@* -@code{@ @ @ @ IRC::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@* +@code{@ @ @ @ weechat::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@* @code{@} }@* @* @item -@command{IRC::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 Perl.@* Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@* @@ -1377,23 +1372,41 @@ al antiguo comando si el script Perl est@'a cargado. @end itemize @* @emph{Ejemplo:}@* -@code{IRC::add_command_handler ("comando", mi_comando);}@* +@code{weechat::add_command_handler ("comando", mi_comando);}@* @code{sub mi_comando}@* @code{@{ }@* -@code{@ @ @ @ IRC::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@* +@code{@ @ @ @ weechat::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@* @code{@ @ @ @ return 0;}@* @code{@} }@* @* @item -@command{IRC::get_info ( [servidor,] nombre );}@* +@command{weechat::command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat::get_info ( nombre, [servidor] );}@* @* Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* @emph{Par@'ametros:} @itemize @minus -@item @option{servidor}: nombre interno del servidor @item @option{nombre}: nombre de la informaci@'on que se quiere obtener: +@item @option{servidor}: nombre interno del servidor @itemize @minus @item @option{0 o version}: obtener la versi@'on de WeeChat @item @option{1 o nick}: obtener el seud@'onimo @@ -1405,8 +1418,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* @end itemize @* @emph{Ejemplos:}@* -@code{$version = get_info("version");}@* -@code{$nick = get_info("freenode", "nick");}@* +@code{$version = weechat::get_info("version");}@* +@code{$nick = weechat::get_info("nick", "freenode");}@* @* @end itemize @@ -1414,7 +1427,171 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* @node Programas Python, Programas Ruby, Programas Perl, Extensiones @section Programas Python -¡No desarrollado! +@subsection Cargar/descargar programas Python + +Los programas Python se cargan y descargan con el comando @command{/python} +(escribiendo @kbd{/help python} en WeeChat para obtener la ayuda acerca del comando).@* + +@emph{Ejemplos:}@* +@itemize @bullet +@item +Cargar un programa Python: @kbd{/python load /tmp/ejemplo.py}@* +@item Descargar todos los programas Python: @kbd{/python unload}@* +@item +Listar los programas Python cargados: @kbd{/python}@* +@end itemize + +@subsection Interfaz WeeChat / Python + +@itemize @bullet +@item +@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.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{nombre}: nombre @'unico para identificar el programa (cada programa debe +tener un nombre distinto) +@item @option{versi@'on}: versi@'on del programa +@item @option{funci@'on_final}: funci@'on Python llamada cuando el programa finaliza +(par@'ametro facultativo, una cadena llena significa que no hay ninguna funci@'on que llamar) +@item @option{descripci@'on}: descripci@'on breve del programa +@end itemize +@* +@emph{Ejemplo:}@* +@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@* +@* + +@item +@command{weechat.prnt ( mensaje, [canal, [servidor]] );}@* +@* +Escribe un mensaje en un canal.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{mensaje}: mensaje a escribir +@item @option{canal}: nombre del canal +@item @option{servidor}: (opcional) nombre interno del servidor +@end itemize +@* +@emph{Ejemplo:}@* +@code{weechat.prnt ("mensaje");}@* +@code{weechat.prnt ("mensaje", "#weechat");}@* +@code{weechat.prnt ("mensaje", "#weechat", "freenode");}@* +@* + +@item +@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 +(si es 0, el mensaje no se borrar@'a). +@item @option{message}: mensaje que se escribir@'a en la barra de informaciones. +@end itemize +@* +@emph{Ejemplo:}@* +@code{weechat.print_infobar (5, "mensaje");}@* +@* + +@item +@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.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{nombre}: nombre del mensaje IRC que producir@'a la llamada a la funci@'on.@* +Para saber qu@'e tipo de mensajes IRC existen puede leer las +RFC 1459 y/o 2812:@* +RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@* +RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} +@item @option{funci@'on}: funci@'on en Python llamada cuando se reciba el mensaje. +@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{@} }@* +@* + +@item +@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}.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{nombre}: nombre del nuevo comando@* +Puede ser un comando que ya existe, y en este caso el nuevo comando sustituir@'a +el antiguo. Ten cuidado cuando sustituyas a un comando de WeeChat, no podr@'a acceder +al antiguo comando si el script Python est@'a cargado. +@item @option{funcion}: funci@'on Python assiciada al comando. +@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{@} }@* +@* + +@item +@command{weechat.command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat.get_info ( nombre, [servidor] );}@* +@* +Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{nombre}: nombre de la informaci@'on que se quiere obtener: +@item @option{servidor}: nombre interno del servidor +@itemize @minus +@item @option{0 o version}: obtener la versi@'on de WeeChat +@item @option{1 o nick}: obtener el seud@'onimo +@item @option{2 o channel}: obtener el nombre del canal +@item @option{3 o server}: obtener el nombre del servidor +@item @option{4 o weechatdir}: obtener el directorio home de WeeChat +@item @option{5 o away}: obtener la informaci@'on "away" del servidor +@end itemize +@end itemize +@* +@emph{Ejemplos:}@* +@code{$version = weechat.get_info("version");}@* +@code{$nick = weechat.get_info("nick", "freenode");}@* +@* + +@end itemize @node Programas Ruby, , Programas Python, Extensiones @section Programas Ruby diff --git a/doc/weechat_doc_fr.texi b/doc/weechat_doc_fr.texi index dcae267bd..87619a984 100644 --- a/doc/weechat_doc_fr.texi +++ b/doc/weechat_doc_fr.texi @@ -35,7 +35,7 @@ @title WeeChat - Guide utilisateur @subtitle Client IRC rapide, l@'eger et extensible -@subtitle Documentation pour WeeChat v0.1.2-cvs - 30 Avril 2005 +@subtitle Documentation pour WeeChat v0.1.2-cvs - 08 Mai 2005 @image{weechat_image} @@ -765,13 +765,20 @@ afficher l'aide sur les commandes@* @* commande: nom d'une commande WeeChat ou IRC@* @* -@item perl [load fichier] | [autoload] | [unload] +@item perl [load fichier] | [autoload] | [reload] | [unload] @* liste/charge/d@'echarge des scripts Perl@* @* fichier: script Perl (fichier) @`a charger@* Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@* @* +@item python [load fichier] | [autoload] | [reload] | [unload] +@* +liste/charge/d@'echarge des scripts Python@* +@* +fichier: script Python (fichier) @`a charger@* +Sans param@`etre, la commande /python liste tous les scripts Python charg@'es.@* +@* @item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur] @* liste, ajoute ou retire des serveurs@* @@ -995,11 +1002,12 @@ lister les utilisateurs sur des canaux@* @* canal: nom du canal@* @* -@item nick pseudo +@item nick [-all] pseudo @* changer le pseudo courant@* @* -pseudo: nouveau pseudo pour le serveur IRC courant@* +-all: d@'efinir le nouveau pseudo sur tous les serveurs connect@'es@* +pseudo: nouveau pseudo@* @* @item notice pseudo texte @* @@ -1266,7 +1274,7 @@ Lister les scripts Perl charg@'es : @kbd{/perl}@* @itemize @bullet @item -@command{IRC::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 Perl.@* Tout script Perl pour WeeChat doit appeler cette fonction.@* @@ -1283,42 +1291,29 @@ de fonction @`a appeler) @end itemize @* @emph{Exemple :}@* -@code{IRC::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@* +@code{weechat::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@* @* @item -@command{IRC::print ( message );}@* -@* -Affiche un message dans la fen@^etre courante (canal ou serveur).@* - -@emph{Param@`etres :} -@itemize @minus -@item @option{message}: message @`a afficher -@end itemize -@* -@emph{Exemple :}@* -@code{IRC::print ("message");}@* -@* - -@item -@command{IRC::print_with_channel ( canal, [serveur,] message );}@* +@command{weechat::print ( message, [canal, [serveur]] );}@* @* Affiche un message dans un canal.@* @emph{Param@`etres :} @itemize @minus +@item @option{message}: message @`a afficher @item @option{canal}: nom du canal @item @option{serveur}: nom interne du serveur -@item @option{message}: message @`a afficher @end itemize @* -@emph{Exemples :}@* -@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@* -@code{IRC::print_with_channel ("#weechat", "message");}@* +@emph{Exemple :}@* +@code{weechat::print ("message");}@* +@code{weechat::print ("message", "#weechat");}@* +@code{weechat::print ("message", "#weechat", "freenode");}@* @* @item -@command{IRC::print_infobar ( d@'elai, message );}@* +@command{weechat::print_infobar ( d@'elai, message );}@* @* Affiche un message dans la barre d'infos.@* @@ -1330,11 +1325,11 @@ Affiche un message dans la barre d'infos.@* @end itemize @* @emph{Exemple :}@* -@code{IRC::print_infobar (5, "message");}@* +@code{weechat::print_infobar (5, "message");}@* @* @item -@command{IRC::add_message_handler ( nom, fonction );}@* +@command{weechat::add_message_handler ( nom, fonction );}@* @* Attache une fonction Perl @`a un message IRC particulier.@* La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@* @@ -1350,18 +1345,18 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Exemple :}@* -@code{IRC::add_message_handler ("privmsg", ma_fonction);}@* +@code{weechat::add_message_handler ("privmsg", ma_fonction);}@* @code{sub ma_fonction}@* @code{@{ }@* -@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@* +@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@* @code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@* @code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@* -@code{@ @ @ @ IRC::print ("masque=$masque, canal=$canal, message=$message\n");}@* +@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, message=$message\n");}@* @code{@} }@* @* @item -@command{IRC::add_command_handler ( nom, fonction );}@* +@command{weechat::add_command_handler ( nom, fonction );}@* @* Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Perl.@* La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@* @@ -1376,23 +1371,41 @@ ne seront plus accessibles tant que le script Perl sera charg@'e. @end itemize @* @emph{Exemple :}@* -@code{IRC::add_command_handler ("commande", ma_commande);}@* +@code{weechat::add_command_handler ("commande", ma_commande);}@* @code{sub ma_commande}@* @code{@{ }@* -@code{@ @ @ @ IRC::print("Serveur: $_[0], param@`etres: $_[1]\n");}@* +@code{@ @ @ @ weechat::print("Serveur: $_[0], param@`etres: $_[1]\n");}@* @code{@ @ @ @ return 0;}@* @code{@} }@* @* @item -@command{IRC::get_info ( [serveur,] nom );}@* +@command{weechat::command ( commande, [canal, [serveur]] );}@* +@* +Ex@'ecute une commande ou envoie un message @'a un canal.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal) +@item @option{canal}: nom du canal +@item @option{serveur}: nom interne du serveur +@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");}@* +@* + +@item +@command{weechat::get_info ( nom, [serveur] );}@* @* Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@* @emph{Param@`etres :} @itemize @minus -@item @option{serveur}: nom interne du serveur @item @option{nom}: nom de l'info @`a obtenir : +@item @option{serveur}: nom interne du serveur @itemize @minus @item @option{0 ou version}: obtenir la version de WeeChat @item @option{1 ou nick}: obtenir le pseudo @@ -1405,7 +1418,7 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@* @* @emph{Exemples :}@* @code{$version = get_info("version");}@* -@code{$nick = get_info("freenode", "nick");}@* +@code{$nick = get_info("nick", "freenode");}@* @* @end itemize @@ -1413,7 +1426,172 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@* @node Scripts Python, Scripts Ruby, Scripts Perl, Extensions @section Scripts Python -Non d@'evelopp@'e ! +@subsection Charger/d@'echarger des scripts Python + +Les scripts Python sont charg@'es et d@'echarg@'es avec la commande @command{/python} +(tapez @kbd{/help python} dans WeeChat pour obtenir de l'aide sur la commande).@* + +@emph{Exemples :}@* +@itemize @bullet +@item +Charger un script Python : @kbd{/python load /tmp/essai.py}@* +@item D@'echarger tous les scripts Python : @kbd{/python unload}@* +@item +Lister les scripts Python charg@'es : @kbd{/python}@* +@end itemize + +@subsection Interface WeeChat / Python + +@itemize @bullet +@item +@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.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{nom}: nom unique pour identifier le script (chaque script doit +avoir un nom diff@'erent) +@item @option{version}: version du script +@item @option{fonction_de_fin}: fonction Python appel@'ee quand le script est +d@'echarg@'e (param@`etre facultatif, une cha@^ine vide signifiant qu'il n'y a pas +de fonction @`a appeler) +@item @option{description}: description br@`eve du script. +@end itemize +@* +@emph{Exemple :}@* +@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !");}@* +@* + +@item +@command{weechat.prnt ( message, [canal, [serveur]] );}@* +@* +Affiche un message dans un canal.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{message}: message @`a afficher +@item @option{canal}: nom du canal +@item @option{serveur}: nom interne du serveur +@end itemize +@* +@emph{Exemple :}@* +@code{weechat.prnt ("message");}@* +@code{weechat.prnt ("message", "#weechat");}@* +@code{weechat.prnt ("message", "#weechat", "freenode");}@* +@* + +@item +@command{weechat.print_infobar ( d@'elai, message );}@* +@* +Affiche un message dans la barre d'infos.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{d@'elai}: d@'elai (en secondes) pendant lequel le message est affich@'e +(si 0, le message ne sera pas effac@'e). +@item @option{message}: message @`a afficher +@end itemize +@* +@emph{Exemple :}@* +@code{weechat.print_infobar (5, "message");}@* +@* + +@item +@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.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{nom}: nom du message IRC pour lequel la fonction est appel@'ee@* +Pour conna@^itre la liste des messages IRC disponibles, merci de consulter les +RFC 1459 et/ou 2812 :@* +RFC 1459 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@* +RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} +@item @option{fonction}: fonction Python appel@'ee lorsque le message est re@,{c}u +@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{@} }@* +@* + +@item +@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}.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{nom}: nom de la nouvelle commande@* +Il peut s'agir d'une commande existante, auquel cas celle-ci est @'ecras@'ee par +la fonction Python. Soyez prudent en @'ecrasant les commandes WeeChat, car elles +ne seront plus accessibles tant que le script Python sera charg@'e. +@item @option{fonction}: fonction Python associ@'ee @`a la commande +@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{@} }@* +@* + +@item +@command{weechat.command ( commande, [canal, [serveur]] );}@* +@* +Ex@'ecute une commande ou envoie un message @'a un canal.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal) +@item @option{canal}: nom du canal +@item @option{serveur}: nom interne du serveur +@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");}@* +@* + +@item +@command{weechat.get_info ( nom, [serveur] );}@* +@* +Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{nom}: nom de l'info @`a obtenir : +@item @option{serveur}: nom interne du serveur +@itemize @minus +@item @option{0 ou version}: obtenir la version de WeeChat +@item @option{1 ou nick}: obtenir le pseudo +@item @option{2 ou channel}: obtenir le nom du canal +@item @option{3 ou server}: obtenir le nom du serveur +@item @option{4 ou weechatdir}: obtenir le r@'epertoire maison de WeeChat +@item @option{5 ou away}: obtenir le drapeau "away" du serveur +@end itemize +@end itemize +@* +@emph{Exemples :}@* +@code{$version = weechat.get_info("version");}@* +@code{$nick = weechat.get_info("nick", "freenode");}@* +@* + +@end itemize @node Scripts Ruby, , Scripts Python, Extensions @section Scripts Ruby diff --git a/doc/weechat_doc_pt.texi b/doc/weechat_doc_pt.texi index 12ad73322..8b771636a 100644 --- a/doc/weechat_doc_pt.texi +++ b/doc/weechat_doc_pt.texi @@ -35,7 +35,7 @@ @title WeeChat - Guia do Utilizador @subtitle Cliente de IRC rapido, leve e extencivel -@subtitle Documenta@,{c}@~ao do WeeChat v0.1.2-cvs - 30 de Abril de 2005 +@subtitle Documenta@,{c}@~ao do WeeChat v0.1.2-cvs - 08 de Maio de 2005 @image{weechat_image} @@ -398,7 +398,7 @@ Listar todos os Scripts Perl: @kbd{/perl}@* @itemize @bullet @item -@command{IRC::register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@* +@command{weechat::register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@* @* Esta @'e a primeira fun@,{c}@~ao a invocar num Script Perl.@* Todos os Scripts Perl para o Weechat devem invocar esta fun@,{c}@~ao.@* @@ -412,42 +412,29 @@ Todos os Scripts Perl para o Weechat devem invocar esta fun@,{c}@~ao.@* @end itemize @* @emph{Exemplo:}@* -@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@* +@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@* @* @item -@command{IRC::print ( mensagem );}@* -@* -Imprimne uma mensagem na janela actual (canal ou servidor).@* - -@emph{Argumentos:} -@itemize @minus -@item @option{mensagem}: mensagem a mostrar -@end itemize -@* -@emph{Exemplo:}@* -@code{IRC::print ("mensagem");}@* -@* - -@item -@command{IRC::print_with_channel ( canal, [servidor,] mensagem );}@* +@command{weechat::print ( mensagem, [canal, [servidor]] );}@* @* Imprimne uma mensagem na canal.@* @emph{Argumentos:} @itemize @minus +@item @option{mensagem}: mensagem a mostrar @item @option{canal}: nome da canal @item @option{servidor}: nome interno da servidor -@item @option{mensagem}: mensagem a mostrar @end itemize @* -@emph{Exemplos:}@* -@code{IRC::print_with_channel ("#weechat", "freenode", "mensagem");}@* -@code{IRC::print_with_channel ("#weechat", "mensagem");}@* +@emph{Exemplo:}@* +@code{weechat::print ("mensagem");}@* +@code{weechat::print ("mensagem", "#weechat");}@* +@code{weechat::print ("mensagem", "#weechat", "freenode");}@* @* @item -@command{IRC::print_infobar ( atrasa, mensagem );}@* +@command{weechat::print_infobar ( atrasa, mensagem );}@* @* Imprimne uma mensagem na barra do info.@* @@ -459,11 +446,11 @@ Imprimne uma mensagem na barra do info.@* @end itemize @* @emph{Exemplo:}@* -@code{IRC::print_infobar (5, "mensagem");}@* +@code{weechat::print_infobar (5, "mensagem");}@* @* @item -@command{IRC::add_message_handler ( nome, fun@,{c}@~ao );}@* +@command{weechat::add_message_handler ( nome, fun@,{c}@~ao );}@* @* Anexa uma fun@,{c}@~ao Perl a uma mensagem de IRC.@* A fun@,{c}@~ao ser@'a invocada de cada vez que a mensagem IRC for recebida.@* @@ -478,17 +465,17 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Exemplo:}@* -@code{IRC::add_message_handler ("privmsg", my_function);}@* +@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{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* +@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* @code{@} }@* @* @item -@command{IRC::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 Perl.@* A fun@,{c}@~ao ser@'a chamada quando o utilizador a invocar utilizando @command{/nome}@* @@ -501,23 +488,41 @@ Este nome pode pertencer a um comando j @end itemize @* @emph{Exemplo:}@* -@code{IRC::add_command_handler ("command", my_command);}@* +@code{weechat::add_command_handler ("command", my_command);}@* @code{sub my_command}@* @code{@{ }@* -@code{@ @ @ @ IRC::print("Argumentos: ".@@_[0]);}@* +@code{@ @ @ @ weechat::print("Argumentos: ".@@_[0]);}@* @code{@ @ @ @ return 0;}@* @code{@} }@* @* @item -@command{IRC::get_info ( [servidor,] nome );}@* +@command{weechat::command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat::get_info ( nome, [servidor] );}@* @* Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@* @emph{Argumentos:} @itemize @minus -@item @option{servidor}: nome interno da servidor @item @option{nome}: nome do info a recuperar: +@item @option{servidor}: nome interno da servidor @itemize @minus @item @option{0 ou version}: comece a vers@~ao de WeeChat @item @option{1 ou nick}: comece o nickname @@ -530,7 +535,7 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@* @* @emph{Exemplos:}@* @code{$version = get_info("version");}@* -@code{$nick = get_info("freenode", "nick");}@* +@code{$nick = get_info("nick", "freenode");}@* @* @end itemize @@ -538,7 +543,166 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@* @node Scripts Python, Scripts Ruby, Scripts Perl, Extencoes @section Scripts Python -N@~AO DESENVOLVIDO! +@subsection Carregar/Descarregar Scripts Python + +Os Scripts Python s@~ao carregados e descarregados com o comando @command{/python}. +(escreve @kbd{/help python} dentro do WeeChat para obteres ajuda acerca do comando).@* + +@emph{Exemplos:}@* +@itemize @bullet +@item +Carregar um Script Python: @kbd{/python load /tmp/sample.py}@* +@item +Descarregar todos os Scripts Python: @kbd{/python unload}@* +@item +Listar todos os Scripts Python: @kbd{/python}@* +@end itemize + +@subsection Interface WeeChat / Python + +@itemize @bullet +@item +@command{weechat.register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@* +@* +Esta @'e a primeira fun@,{c}@~ao a invocar num Script Python.@* +Todos os Scripts Python para o Weechat devem invocar esta fun@,{c}@~ao.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{nome}: nome @'unico que indentifique o script (cada Script Python deve ter um @'unico nome) +@item @option{vers@~ao}: vers@~ao do script +@item @option{fun@,{c}@~ao_de_shutdown}: fun@,{c}@~ao Python invocada quando o script é descarregado (par@^ametro opcional, se deixado em branco significa que nada deve ser chamado) +@item @option{descri@,{c}@~ao}: breve descri@,{c}@~ao do script. +@end itemize +@* +@emph{Exemplo:}@* +@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@* +@* + +@item +@command{weechat.prnt ( mensagem, [canal, [servidor]] );}@* +@* +Imprimne uma mensagem na canal.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{mensagem}: mensagem a mostrar +@item @option{canal}: nome da canal +@item @option{servidor}: nome interno da servidor +@end itemize +@* +@emph{Exemplo:}@* +@code{weechat.prnt ("mensagem");}@* +@code{weechat.prnt ("mensagem", "#weechat");}@* +@code{weechat.prnt ("mensagem", "#weechat", "freenode");}@* +@* + +@item +@command{weechat.print_infobar ( atrasa, mensagem );}@* +@* +Imprimne uma mensagem na barra do info.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{atrasa}: depois que isto atrasa (nos segundos), a mensagem estar@'a apagada +(se 0, mensagem n@~ao forem apagados). +@item @option{mensagem}: mensagem a mostrar +@end itemize +@* +@emph{Exemplo:}@* +@code{weechat.print_infobar (5, "mensagem");}@* +@* + +@item +@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.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{nome}: nome da mensagem IRC@* +Para conheceres uma lista de mensagens de IRC, por favor lê o RFC 1459 e/ou o 2812:@* +RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@* +RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} +@item @option{fun@,{c}@~ao}: fun@,{c}@~ao Python invocada quando a mensagem é recebida +@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{@} }@* +@* + +@item +@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}@* + +@emph{Argumentos:} +@itemize @minus +@item @option{nome}: nome do novo comando@* +Este nome pode pertencer a um comando já existente, o qual ser@'a sobreposto pela fun@,{c}@~ao Python. Tem cuidado quando fizeres isto: os comandos originais não estar@~ao acessiveis antes de teres descarregado o Script Python. +@item @option{fun@,{c}@~ao}: fun@,{c}@~ao Python ligada ao comando +@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{@} }@* +@* + +@item +@command{weechat.command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat.get_info ( nome, [servidor] );}@* +@* +Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{nome}: nome do info a recuperar: +@item @option{servidor}: nome interno da servidor +@itemize @minus +@item @option{0 ou version}: comece a vers@~ao de WeeChat +@item @option{1 ou nick}: comece o nickname +@item @option{2 ou channel}: comece o nome da canal +@item @option{3 ou server}: comece o nome do servidor +@item @option{4 ou weechatdir}: comece a WeeChat o diret@'orio home +@item @option{5 ou away}: comece a bandeira ausente para o servidor +@end itemize +@end itemize +@* +@emph{Exemplos:}@* +@code{$version = weechat.get_info("version");}@* +@code{$nick = weechat.get_info("nick", "freenode");}@* +@* + +@end itemize @node Scripts Ruby, , Scripts Python, Extencoes @section Scripts Ruby diff --git a/weechat/doc/weechat_doc_en.texi b/weechat/doc/weechat_doc_en.texi index d7c25597a..1ea73053e 100644 --- a/weechat/doc/weechat_doc_en.texi +++ b/weechat/doc/weechat_doc_en.texi @@ -35,7 +35,7 @@ @title WeeChat - User guide @subtitle Fast, light and extensible IRC client -@subtitle Documentation for WeeChat v0.1.2-cvs - April, 30 2005 +@subtitle Documentation for WeeChat v0.1.2-cvs - May, 08 2005 @image{weechat_image} @@ -765,13 +765,20 @@ display help about commands@* @* command: name of a WeeChat or IRC command@* @* -@item perl [load filename] | [autoload] | [unload] +@item perl [load filename] | [autoload] | [reload] | [unload] @* list/load/unload Perl scripts@* @* filename: Perl script (file) to load@* Without argument, /perl command lists all loaded Perl scripts.@* @* +@item python [load filename] | [autoload] | [reload] | [unload] +@* +list/load/unload Python scripts@* +@* +filename: Python script (file) to load@* +Without argument, /python command lists all loaded Python scripts.@* +@* @item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername] @* list, add or remove servers@* @@ -995,11 +1002,12 @@ list nicknames on channels@* @* channel: channel name@* @* -@item nick nickname +@item nick [-all] nickname @* change current nickname@* @* -nickname: new nickname for current IRC server@* +-all: set new nickname for all connected servers@* +nickname: new nickname@* @* @item notice nickname text @* @@ -1266,7 +1274,7 @@ List all Perl scripts: @kbd{/perl}@* @itemize @bullet @item -@command{IRC::register ( name, version, shutdown_function, description );}@* +@command{weechat::register ( name, version, shutdown_function, description );}@* @* This is first function to call in Perl script.@* All Perl scripts for WeeChat should call this function.@* @@ -1282,42 +1290,29 @@ unloaded (optional parameter, empty string means nothing is called at the end) @end itemize @* @emph{Example:}@* -@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@* +@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@* @* @item -@command{IRC::print ( message );}@* -@* -Print message in current window (channel or server).@* - -@emph{Arguments:} -@itemize @minus -@item @option{message}: message to display -@end itemize -@* -@emph{Example:}@* -@code{IRC::print ("message");}@* -@* - -@item -@command{IRC::print_with_channel ( channel, [server,] message );}@* +@command{weechat::print ( message, [channel, [server]] );}@* @* Print message in a channel.@* @emph{Arguments:} @itemize @minus +@item @option{message}: message to display @item @option{channel}: name of channel @item @option{server}: internal name of server -@item @option{message}: message to display @end itemize @* @emph{Examples:}@* -@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@* -@code{IRC::print_with_channel ("#weechat", "message");}@* +@code{weechat::print ("message");}@* +@code{weechat::print ("message", "#weechat");}@* +@code{weechat::print ("message", "#weechat", "freenode");}@* @* @item -@command{IRC::print_infobar ( delay, message );}@* +@command{weechat::print_infobar ( delay, message );}@* @* Print message in infobar.@* @@ -1329,11 +1324,11 @@ Print message in infobar.@* @end itemize @* @emph{Example:}@* -@code{IRC::print_infobar (5, "message");}@* +@code{weechat::print_infobar (5, "message");}@* @* @item -@command{IRC::add_message_handler ( name, function );}@* +@command{weechat::add_message_handler ( name, function );}@* @* Attach a Perl function to an IRC message.@* Function will be called each time IRC message will be received.@* @@ -1348,18 +1343,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Example:}@* -@code{IRC::add_message_handler ("privmsg", my_function);}@* +@code{weechat::add_message_handler ("privmsg", my_function);}@* @code{sub my_function}@* @code{@{ }@* -@code{@ @ @ @ IRC::print ("server=$_[0]\n");}@* +@code{@ @ @ @ weechat::print ("server=$_[0]\n");}@* @code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@* @code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@* -@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* +@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* @code{@} }@* @* @item -@command{IRC::add_command_handler ( name, function );}@* +@command{weechat::add_command_handler ( name, function );}@* @* Create new WeeChat command, linked with Perl function.@* Function will be called when user will launch command with @kbd{/name}.@* @@ -1374,23 +1369,41 @@ available until your Perl script will be unloaded. @end itemize @* @emph{Example:}@* -@code{IRC::add_command_handler ("command", my_command);}@* +@code{weechat::add_command_handler ("command", my_command);}@* @code{sub my_command}@* @code{@{ }@* -@code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@* +@code{@ @ @ @ weechat::print("Server: $_[0], arguments: $_[1]\n");}@* @code{@ @ @ @ return 0;}@* @code{@} }@* @* @item -@command{IRC::get_info ( [server,] name );}@* +@command{weechat::command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat::get_info ( name, [server] );}@* @* Get various info about WeeChat, server or user.@* @emph{Arguments:} @itemize @minus -@item @option{server}: internal name of server @item @option{name}: name of info to retrieve: +@item @option{server}: internal name of server @itemize @minus @item @option{0 or version}: get WeeChat version @item @option{1 or nick}: get nickname @@ -1403,7 +1416,7 @@ Get various info about WeeChat, server or user.@* @* @emph{Examples:}@* @code{$version = get_info("version");}@* -@code{$nick = get_info("freenode", "nick");}@* +@code{$nick = get_info("nick", "freenode");}@* @* @end itemize @@ -1411,7 +1424,172 @@ Get various info about WeeChat, server or user.@* @node Python scripts, Ruby scripts, Perl scripts, Extensions @section Python scripts -Not developed! +@subsection Load/unload Python scripts + +Python scripts are loaded and unloaded with @command{/python} command. +(type @kbd{/help python} within WeeChat to get help about command).@* + +@emph{Examples:}@* +@itemize @bullet +@item +Load a Python script: @kbd{/python load /tmp/sample.py}@* +@item +Unload all Python scripts: @kbd{/python unload}@* +@item +List all Python scripts: @kbd{/python}@* +@end itemize + +@subsection WeeChat / Python API + +@itemize @bullet +@item +@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.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: unique name to identify script (each script must have +unique name) +@item @option{version}: script's version +@item @option{shutdown_function}: Python function called when script is +unloaded (optional parameter, empty string means nothing is called at the end) +@item @option{description}: short description of script. +@end itemize +@* +@emph{Example:}@* +@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@* +@* + +@item +@command{weechat.prnt ( message, [channel, [server]] );}@* +@* +Print message in a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{message}: message to display +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@end itemize +@* +@emph{Examples:}@* +@code{weechat.prnt ("message");}@* +@code{weechat.prnt ("message", "#weechat");}@* +@code{weechat.prnt ("message", "#weechat", "freenode");}@* +@* + +@item +@command{weechat.print_infobar ( delay, message );}@* +@* +Print message in infobar.@* + +@emph{Arguments:} +@itemize @minus +@item @option{delay}: after this delay (in seconds), message will be erased +(if 0, message will not be erased). +@item @option{message}: message to display +@end itemize +@* +@emph{Example:}@* +@code{weechat.print_infobar (5, "message");}@* +@* + +@item +@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.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: name of IRC message@* +To know list of IRC messages, please refer to RFC 1459 and/or 2812:@* +RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@* +RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} +@item @option{function}: Python function called when message is received +@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{@} }@* +@* + +@item +@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}.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: name of new command@* +This name may be existing command, so that the command is overrided by +Python function. Be careful when overriding WeeChat commands, they'll not be +available until your Python script will be unloaded. +@item @option{function}: Python function linked with command +@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{@} }@* +@* + +@item +@command{weechat.command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + + +@item +@command{weechat.get_info ( name, [server] );}@* +@* +Get various info about WeeChat, server or user.@* + +@emph{Arguments:} +@itemize @minus +@item @option{name}: name of info to retrieve: +@item @option{server}: internal name of server +@itemize @minus +@item @option{0 or version}: get WeeChat version +@item @option{1 or nick}: get nickname +@item @option{2 or channel}: get channel name +@item @option{3 or server}: get server name +@item @option{4 or weechatdir}: get WeeChat home directory +@item @option{5 or away}: get away flag for server +@end itemize +@end itemize +@* +@emph{Examples:}@* +@code{$version = weechat.get_info("version");}@* +@code{$nick = weechat.get_info("nick", "freenode");}@* +@* + +@end itemize @node Ruby scripts, , Python scripts, Extensions @section Ruby scripts diff --git a/weechat/doc/weechat_doc_es.texi b/weechat/doc/weechat_doc_es.texi index d11940585..8fd2f6eab 100644 --- a/weechat/doc/weechat_doc_es.texi +++ b/weechat/doc/weechat_doc_es.texi @@ -35,7 +35,7 @@ @title WeeChat - Gui@'on de usuario. @subtitle Cliente IRC r@'apido, peque@~no y extensible -@subtitle Documentaci@'on para WeeChat v0.1.2 - 30 de abril de 2005 +@subtitle Documentaci@'on para WeeChat v0.1.2 - 08 de mayo de 2005 @image{weechat_image} @@ -755,9 +755,9 @@ nombre_del_servidor: nombre del servidor del que desconectarse@* @* @item debug dump @* -print debug messages@* +imprime mensajes de depuraci@'on@* @* -dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)@* +volcado: almacena un volcado de memoria en el archivo de registro de Weechat (se escribe el mismo volcado cuando Weechat se cuelga)@* @* @item help [comando] @* @@ -765,13 +765,20 @@ mostrar ayuda sobre los comandos@* @* comando: nombre de un comando de Weechat @'o de IRC@* @* -@item perl [load fichero] | [autoload] | [unload] +@item perl [load fichero] | [autoload] | [reload] | [unload] @* lista/carga/descarga de los Perl scripts@* @* fichero: Perl script (archivo) a cargar@* Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@* @* +@item python [load fichero] | [autoload] | [reload] | [unload] +@* +lista/carga/descarga de los Python scripts@* +@* +fichero: Python script (archivo) a cargar@* +Sin argumentos, el comando /python lista todos los Python scripts cargados.@* +@* @item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor] @* lista, a@~nade o elimina servidores@* @@ -836,10 +843,10 @@ mensaje: mensaje para el estado ausente (si no se da ning @* @item ban [canal] [usariio [usuario ...]] @* -bans nicks or hosts@* +banea usuarios o m@'aquinas@* @* -channel: channel for ban@* -nickname: user or host to ban@* +canal: canal en el que banear@* +usuario: nombre de usuario o m@'aquina a banear@* @* @item ctcp usuario tipo @* @@ -912,11 +919,11 @@ comentario: comentario para la expulsi@'on@* @* @item kickban [canal] usuario [comentario] @* -kicks and bans a nick from a channel@* +expulsa y banea a un usuario de un canal@* @* -channel: channel where user is@* -nickname: nickname to kick and ban@* -comment: comment for kick@* +canal: canal donde est@'a el usuario@* +usuario: nombre de usuario a expulsar y banear@* +comentario: comentario para la expulsi@'on@* @* @item kill usuario comentario @* @@ -995,11 +1002,12 @@ listar usuarios en canales@* @* canal: nombre del canal@* @* -@item nick usuario +@item nick [-all] usuarios @* cambiar el nombre de usuario actual@* @* -usuario: nuevo nombre de usuario para el servidor IRC actual@* +-all: set new nickname for all connected servers@* +nickname: new nickname@* @* @item notice usuario texto @* @@ -1130,10 +1138,10 @@ target: servidor objetivo@* @* @item unban [canal] usuario [usuario ...] @* -unbans nicks or hosts@* +desbanea usuarios o m@'aquinas@* @* -channel: channel for unban@* -nickname: user or host to unban@* +canal: canal en el que desbanear (quitar la prohibici@'on)@* +usuario: usuario o m@'aquina a desbanear@* @* @item userhost usuario [usuario ...] @* @@ -1268,7 +1276,7 @@ Listar los programas Perl cargados: @kbd{/perl}@* @itemize @bullet @item -@command{IRC::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 Perl.@* Todos los programas en Perl para WeeChat deben llamar esta funci@'on.@* @@ -1284,42 +1292,29 @@ tener un nombre distinto) @end itemize @* @emph{Ejemplo:}@* -@code{IRC::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@* +@code{weechat::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@* @* @item -@command{IRC::print ( mensaje );}@* -@* -Escribe un mensaje en la ventana actual (canal o servidor).@* - -@emph{Par@'ametros:} -@itemize @minus -@item @option{mensaje}: mensaje a escribir -@end itemize -@* -@emph{Ejemplo:}@* -@code{IRC::print ("mensaje");}@* -@* - -@item -@command{IRC::print_with_channel ( canal, [servidor,] mensaje );}@* +@command{weechat::print ( mensaje, [canal, [servidor]] );}@* @* Escribe un mensaje en un canal.@* @emph{Par@'ametros:} @itemize @minus +@item @option{mensaje}: mensaje a escribir @item @option{canal}: nombre del canal @item @option{servidor}: (opcional) nombre interno del servidor -@item @option{mensaje}: mensaje que debe escribir en el canal @end itemize @* -@emph{Ejemplos:}@* -@code{IRC::print_with_channel ("#weechat", "freenode", "mensaje");}@* -@code{IRC::print_with_channel ("#weechat", "mensaje");}@* +@emph{Ejemplo:}@* +@code{weechat::print ("mensaje");}@* +@code{weechat::print ("mensaje", "#weechat");}@* +@code{weechat::print ("mensaje", "#weechat", "freenode");}@* @* @item -@command{IRC::print_infobar ( retraso, mensaje );}@* +@command{weechat::print_infobar ( retraso, mensaje );}@* @* Escribir un mensaje en la barra de informaciones.@* @@ -1331,11 +1326,11 @@ Escribir un mensaje en la barra de informaciones.@* @end itemize @* @emph{Ejemplo:}@* -@code{IRC::print_infobar (5, "mensaje");}@* +@code{weechat::print_infobar (5, "mensaje");}@* @* @item -@command{IRC::add_message_handler ( nombre, funci@'on );}@* +@command{weechat::add_message_handler ( nombre, funci@'on );}@* @* Adjunta una funci@'on Perl a un mensaje IRC.@* Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@* @@ -1351,18 +1346,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Ejemplo:}@* -@code{IRC::add_message_handler ("privmsg", mi_funcion);}@* +@code{weechat::add_message_handler ("privmsg", mi_funcion);}@* @code{sub mi_funcion}@* @code{@{ }@* -@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@* +@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@* @code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@* @code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@* -@code{@ @ @ @ IRC::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@* +@code{@ @ @ @ weechat::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@* @code{@} }@* @* @item -@command{IRC::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 Perl.@* Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@* @@ -1377,23 +1372,41 @@ al antiguo comando si el script Perl est@'a cargado. @end itemize @* @emph{Ejemplo:}@* -@code{IRC::add_command_handler ("comando", mi_comando);}@* +@code{weechat::add_command_handler ("comando", mi_comando);}@* @code{sub mi_comando}@* @code{@{ }@* -@code{@ @ @ @ IRC::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@* +@code{@ @ @ @ weechat::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@* @code{@ @ @ @ return 0;}@* @code{@} }@* @* @item -@command{IRC::get_info ( [servidor,] nombre );}@* +@command{weechat::command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat::get_info ( nombre, [servidor] );}@* @* Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* @emph{Par@'ametros:} @itemize @minus -@item @option{servidor}: nombre interno del servidor @item @option{nombre}: nombre de la informaci@'on que se quiere obtener: +@item @option{servidor}: nombre interno del servidor @itemize @minus @item @option{0 o version}: obtener la versi@'on de WeeChat @item @option{1 o nick}: obtener el seud@'onimo @@ -1405,8 +1418,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* @end itemize @* @emph{Ejemplos:}@* -@code{$version = get_info("version");}@* -@code{$nick = get_info("freenode", "nick");}@* +@code{$version = weechat::get_info("version");}@* +@code{$nick = weechat::get_info("nick", "freenode");}@* @* @end itemize @@ -1414,7 +1427,171 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* @node Programas Python, Programas Ruby, Programas Perl, Extensiones @section Programas Python -¡No desarrollado! +@subsection Cargar/descargar programas Python + +Los programas Python se cargan y descargan con el comando @command{/python} +(escribiendo @kbd{/help python} en WeeChat para obtener la ayuda acerca del comando).@* + +@emph{Ejemplos:}@* +@itemize @bullet +@item +Cargar un programa Python: @kbd{/python load /tmp/ejemplo.py}@* +@item Descargar todos los programas Python: @kbd{/python unload}@* +@item +Listar los programas Python cargados: @kbd{/python}@* +@end itemize + +@subsection Interfaz WeeChat / Python + +@itemize @bullet +@item +@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.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{nombre}: nombre @'unico para identificar el programa (cada programa debe +tener un nombre distinto) +@item @option{versi@'on}: versi@'on del programa +@item @option{funci@'on_final}: funci@'on Python llamada cuando el programa finaliza +(par@'ametro facultativo, una cadena llena significa que no hay ninguna funci@'on que llamar) +@item @option{descripci@'on}: descripci@'on breve del programa +@end itemize +@* +@emph{Ejemplo:}@* +@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@* +@* + +@item +@command{weechat.prnt ( mensaje, [canal, [servidor]] );}@* +@* +Escribe un mensaje en un canal.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{mensaje}: mensaje a escribir +@item @option{canal}: nombre del canal +@item @option{servidor}: (opcional) nombre interno del servidor +@end itemize +@* +@emph{Ejemplo:}@* +@code{weechat.prnt ("mensaje");}@* +@code{weechat.prnt ("mensaje", "#weechat");}@* +@code{weechat.prnt ("mensaje", "#weechat", "freenode");}@* +@* + +@item +@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 +(si es 0, el mensaje no se borrar@'a). +@item @option{message}: mensaje que se escribir@'a en la barra de informaciones. +@end itemize +@* +@emph{Ejemplo:}@* +@code{weechat.print_infobar (5, "mensaje");}@* +@* + +@item +@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.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{nombre}: nombre del mensaje IRC que producir@'a la llamada a la funci@'on.@* +Para saber qu@'e tipo de mensajes IRC existen puede leer las +RFC 1459 y/o 2812:@* +RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@* +RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} +@item @option{funci@'on}: funci@'on en Python llamada cuando se reciba el mensaje. +@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{@} }@* +@* + +@item +@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}.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{nombre}: nombre del nuevo comando@* +Puede ser un comando que ya existe, y en este caso el nuevo comando sustituir@'a +el antiguo. Ten cuidado cuando sustituyas a un comando de WeeChat, no podr@'a acceder +al antiguo comando si el script Python est@'a cargado. +@item @option{funcion}: funci@'on Python assiciada al comando. +@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{@} }@* +@* + +@item +@command{weechat.command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat.get_info ( nombre, [servidor] );}@* +@* +Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@* + +@emph{Par@'ametros:} +@itemize @minus +@item @option{nombre}: nombre de la informaci@'on que se quiere obtener: +@item @option{servidor}: nombre interno del servidor +@itemize @minus +@item @option{0 o version}: obtener la versi@'on de WeeChat +@item @option{1 o nick}: obtener el seud@'onimo +@item @option{2 o channel}: obtener el nombre del canal +@item @option{3 o server}: obtener el nombre del servidor +@item @option{4 o weechatdir}: obtener el directorio home de WeeChat +@item @option{5 o away}: obtener la informaci@'on "away" del servidor +@end itemize +@end itemize +@* +@emph{Ejemplos:}@* +@code{$version = weechat.get_info("version");}@* +@code{$nick = weechat.get_info("nick", "freenode");}@* +@* + +@end itemize @node Programas Ruby, , Programas Python, Extensiones @section Programas Ruby diff --git a/weechat/doc/weechat_doc_fr.texi b/weechat/doc/weechat_doc_fr.texi index dcae267bd..87619a984 100644 --- a/weechat/doc/weechat_doc_fr.texi +++ b/weechat/doc/weechat_doc_fr.texi @@ -35,7 +35,7 @@ @title WeeChat - Guide utilisateur @subtitle Client IRC rapide, l@'eger et extensible -@subtitle Documentation pour WeeChat v0.1.2-cvs - 30 Avril 2005 +@subtitle Documentation pour WeeChat v0.1.2-cvs - 08 Mai 2005 @image{weechat_image} @@ -765,13 +765,20 @@ afficher l'aide sur les commandes@* @* commande: nom d'une commande WeeChat ou IRC@* @* -@item perl [load fichier] | [autoload] | [unload] +@item perl [load fichier] | [autoload] | [reload] | [unload] @* liste/charge/d@'echarge des scripts Perl@* @* fichier: script Perl (fichier) @`a charger@* Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@* @* +@item python [load fichier] | [autoload] | [reload] | [unload] +@* +liste/charge/d@'echarge des scripts Python@* +@* +fichier: script Python (fichier) @`a charger@* +Sans param@`etre, la commande /python liste tous les scripts Python charg@'es.@* +@* @item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur] @* liste, ajoute ou retire des serveurs@* @@ -995,11 +1002,12 @@ lister les utilisateurs sur des canaux@* @* canal: nom du canal@* @* -@item nick pseudo +@item nick [-all] pseudo @* changer le pseudo courant@* @* -pseudo: nouveau pseudo pour le serveur IRC courant@* +-all: d@'efinir le nouveau pseudo sur tous les serveurs connect@'es@* +pseudo: nouveau pseudo@* @* @item notice pseudo texte @* @@ -1266,7 +1274,7 @@ Lister les scripts Perl charg@'es : @kbd{/perl}@* @itemize @bullet @item -@command{IRC::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 Perl.@* Tout script Perl pour WeeChat doit appeler cette fonction.@* @@ -1283,42 +1291,29 @@ de fonction @`a appeler) @end itemize @* @emph{Exemple :}@* -@code{IRC::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@* +@code{weechat::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@* @* @item -@command{IRC::print ( message );}@* -@* -Affiche un message dans la fen@^etre courante (canal ou serveur).@* - -@emph{Param@`etres :} -@itemize @minus -@item @option{message}: message @`a afficher -@end itemize -@* -@emph{Exemple :}@* -@code{IRC::print ("message");}@* -@* - -@item -@command{IRC::print_with_channel ( canal, [serveur,] message );}@* +@command{weechat::print ( message, [canal, [serveur]] );}@* @* Affiche un message dans un canal.@* @emph{Param@`etres :} @itemize @minus +@item @option{message}: message @`a afficher @item @option{canal}: nom du canal @item @option{serveur}: nom interne du serveur -@item @option{message}: message @`a afficher @end itemize @* -@emph{Exemples :}@* -@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@* -@code{IRC::print_with_channel ("#weechat", "message");}@* +@emph{Exemple :}@* +@code{weechat::print ("message");}@* +@code{weechat::print ("message", "#weechat");}@* +@code{weechat::print ("message", "#weechat", "freenode");}@* @* @item -@command{IRC::print_infobar ( d@'elai, message );}@* +@command{weechat::print_infobar ( d@'elai, message );}@* @* Affiche un message dans la barre d'infos.@* @@ -1330,11 +1325,11 @@ Affiche un message dans la barre d'infos.@* @end itemize @* @emph{Exemple :}@* -@code{IRC::print_infobar (5, "message");}@* +@code{weechat::print_infobar (5, "message");}@* @* @item -@command{IRC::add_message_handler ( nom, fonction );}@* +@command{weechat::add_message_handler ( nom, fonction );}@* @* Attache une fonction Perl @`a un message IRC particulier.@* La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@* @@ -1350,18 +1345,18 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Exemple :}@* -@code{IRC::add_message_handler ("privmsg", ma_fonction);}@* +@code{weechat::add_message_handler ("privmsg", ma_fonction);}@* @code{sub ma_fonction}@* @code{@{ }@* -@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@* +@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@* @code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@* @code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@* -@code{@ @ @ @ IRC::print ("masque=$masque, canal=$canal, message=$message\n");}@* +@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, message=$message\n");}@* @code{@} }@* @* @item -@command{IRC::add_command_handler ( nom, fonction );}@* +@command{weechat::add_command_handler ( nom, fonction );}@* @* Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Perl.@* La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@* @@ -1376,23 +1371,41 @@ ne seront plus accessibles tant que le script Perl sera charg@'e. @end itemize @* @emph{Exemple :}@* -@code{IRC::add_command_handler ("commande", ma_commande);}@* +@code{weechat::add_command_handler ("commande", ma_commande);}@* @code{sub ma_commande}@* @code{@{ }@* -@code{@ @ @ @ IRC::print("Serveur: $_[0], param@`etres: $_[1]\n");}@* +@code{@ @ @ @ weechat::print("Serveur: $_[0], param@`etres: $_[1]\n");}@* @code{@ @ @ @ return 0;}@* @code{@} }@* @* @item -@command{IRC::get_info ( [serveur,] nom );}@* +@command{weechat::command ( commande, [canal, [serveur]] );}@* +@* +Ex@'ecute une commande ou envoie un message @'a un canal.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal) +@item @option{canal}: nom du canal +@item @option{serveur}: nom interne du serveur +@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");}@* +@* + +@item +@command{weechat::get_info ( nom, [serveur] );}@* @* Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@* @emph{Param@`etres :} @itemize @minus -@item @option{serveur}: nom interne du serveur @item @option{nom}: nom de l'info @`a obtenir : +@item @option{serveur}: nom interne du serveur @itemize @minus @item @option{0 ou version}: obtenir la version de WeeChat @item @option{1 ou nick}: obtenir le pseudo @@ -1405,7 +1418,7 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@* @* @emph{Exemples :}@* @code{$version = get_info("version");}@* -@code{$nick = get_info("freenode", "nick");}@* +@code{$nick = get_info("nick", "freenode");}@* @* @end itemize @@ -1413,7 +1426,172 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@* @node Scripts Python, Scripts Ruby, Scripts Perl, Extensions @section Scripts Python -Non d@'evelopp@'e ! +@subsection Charger/d@'echarger des scripts Python + +Les scripts Python sont charg@'es et d@'echarg@'es avec la commande @command{/python} +(tapez @kbd{/help python} dans WeeChat pour obtenir de l'aide sur la commande).@* + +@emph{Exemples :}@* +@itemize @bullet +@item +Charger un script Python : @kbd{/python load /tmp/essai.py}@* +@item D@'echarger tous les scripts Python : @kbd{/python unload}@* +@item +Lister les scripts Python charg@'es : @kbd{/python}@* +@end itemize + +@subsection Interface WeeChat / Python + +@itemize @bullet +@item +@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.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{nom}: nom unique pour identifier le script (chaque script doit +avoir un nom diff@'erent) +@item @option{version}: version du script +@item @option{fonction_de_fin}: fonction Python appel@'ee quand le script est +d@'echarg@'e (param@`etre facultatif, une cha@^ine vide signifiant qu'il n'y a pas +de fonction @`a appeler) +@item @option{description}: description br@`eve du script. +@end itemize +@* +@emph{Exemple :}@* +@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !");}@* +@* + +@item +@command{weechat.prnt ( message, [canal, [serveur]] );}@* +@* +Affiche un message dans un canal.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{message}: message @`a afficher +@item @option{canal}: nom du canal +@item @option{serveur}: nom interne du serveur +@end itemize +@* +@emph{Exemple :}@* +@code{weechat.prnt ("message");}@* +@code{weechat.prnt ("message", "#weechat");}@* +@code{weechat.prnt ("message", "#weechat", "freenode");}@* +@* + +@item +@command{weechat.print_infobar ( d@'elai, message );}@* +@* +Affiche un message dans la barre d'infos.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{d@'elai}: d@'elai (en secondes) pendant lequel le message est affich@'e +(si 0, le message ne sera pas effac@'e). +@item @option{message}: message @`a afficher +@end itemize +@* +@emph{Exemple :}@* +@code{weechat.print_infobar (5, "message");}@* +@* + +@item +@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.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{nom}: nom du message IRC pour lequel la fonction est appel@'ee@* +Pour conna@^itre la liste des messages IRC disponibles, merci de consulter les +RFC 1459 et/ou 2812 :@* +RFC 1459 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@* +RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} +@item @option{fonction}: fonction Python appel@'ee lorsque le message est re@,{c}u +@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{@} }@* +@* + +@item +@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}.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{nom}: nom de la nouvelle commande@* +Il peut s'agir d'une commande existante, auquel cas celle-ci est @'ecras@'ee par +la fonction Python. Soyez prudent en @'ecrasant les commandes WeeChat, car elles +ne seront plus accessibles tant que le script Python sera charg@'e. +@item @option{fonction}: fonction Python associ@'ee @`a la commande +@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{@} }@* +@* + +@item +@command{weechat.command ( commande, [canal, [serveur]] );}@* +@* +Ex@'ecute une commande ou envoie un message @'a un canal.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal) +@item @option{canal}: nom du canal +@item @option{serveur}: nom interne du serveur +@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");}@* +@* + +@item +@command{weechat.get_info ( nom, [serveur] );}@* +@* +Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@* + +@emph{Param@`etres :} +@itemize @minus +@item @option{nom}: nom de l'info @`a obtenir : +@item @option{serveur}: nom interne du serveur +@itemize @minus +@item @option{0 ou version}: obtenir la version de WeeChat +@item @option{1 ou nick}: obtenir le pseudo +@item @option{2 ou channel}: obtenir le nom du canal +@item @option{3 ou server}: obtenir le nom du serveur +@item @option{4 ou weechatdir}: obtenir le r@'epertoire maison de WeeChat +@item @option{5 ou away}: obtenir le drapeau "away" du serveur +@end itemize +@end itemize +@* +@emph{Exemples :}@* +@code{$version = weechat.get_info("version");}@* +@code{$nick = weechat.get_info("nick", "freenode");}@* +@* + +@end itemize @node Scripts Ruby, , Scripts Python, Extensions @section Scripts Ruby diff --git a/weechat/doc/weechat_doc_pt.texi b/weechat/doc/weechat_doc_pt.texi index 12ad73322..8b771636a 100644 --- a/weechat/doc/weechat_doc_pt.texi +++ b/weechat/doc/weechat_doc_pt.texi @@ -35,7 +35,7 @@ @title WeeChat - Guia do Utilizador @subtitle Cliente de IRC rapido, leve e extencivel -@subtitle Documenta@,{c}@~ao do WeeChat v0.1.2-cvs - 30 de Abril de 2005 +@subtitle Documenta@,{c}@~ao do WeeChat v0.1.2-cvs - 08 de Maio de 2005 @image{weechat_image} @@ -398,7 +398,7 @@ Listar todos os Scripts Perl: @kbd{/perl}@* @itemize @bullet @item -@command{IRC::register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@* +@command{weechat::register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@* @* Esta @'e a primeira fun@,{c}@~ao a invocar num Script Perl.@* Todos os Scripts Perl para o Weechat devem invocar esta fun@,{c}@~ao.@* @@ -412,42 +412,29 @@ Todos os Scripts Perl para o Weechat devem invocar esta fun@,{c}@~ao.@* @end itemize @* @emph{Exemplo:}@* -@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@* +@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@* @* @item -@command{IRC::print ( mensagem );}@* -@* -Imprimne uma mensagem na janela actual (canal ou servidor).@* - -@emph{Argumentos:} -@itemize @minus -@item @option{mensagem}: mensagem a mostrar -@end itemize -@* -@emph{Exemplo:}@* -@code{IRC::print ("mensagem");}@* -@* - -@item -@command{IRC::print_with_channel ( canal, [servidor,] mensagem );}@* +@command{weechat::print ( mensagem, [canal, [servidor]] );}@* @* Imprimne uma mensagem na canal.@* @emph{Argumentos:} @itemize @minus +@item @option{mensagem}: mensagem a mostrar @item @option{canal}: nome da canal @item @option{servidor}: nome interno da servidor -@item @option{mensagem}: mensagem a mostrar @end itemize @* -@emph{Exemplos:}@* -@code{IRC::print_with_channel ("#weechat", "freenode", "mensagem");}@* -@code{IRC::print_with_channel ("#weechat", "mensagem");}@* +@emph{Exemplo:}@* +@code{weechat::print ("mensagem");}@* +@code{weechat::print ("mensagem", "#weechat");}@* +@code{weechat::print ("mensagem", "#weechat", "freenode");}@* @* @item -@command{IRC::print_infobar ( atrasa, mensagem );}@* +@command{weechat::print_infobar ( atrasa, mensagem );}@* @* Imprimne uma mensagem na barra do info.@* @@ -459,11 +446,11 @@ Imprimne uma mensagem na barra do info.@* @end itemize @* @emph{Exemplo:}@* -@code{IRC::print_infobar (5, "mensagem");}@* +@code{weechat::print_infobar (5, "mensagem");}@* @* @item -@command{IRC::add_message_handler ( nome, fun@,{c}@~ao );}@* +@command{weechat::add_message_handler ( nome, fun@,{c}@~ao );}@* @* Anexa uma fun@,{c}@~ao Perl a uma mensagem de IRC.@* A fun@,{c}@~ao ser@'a invocada de cada vez que a mensagem IRC for recebida.@* @@ -478,17 +465,17 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} @end itemize @* @emph{Exemplo:}@* -@code{IRC::add_message_handler ("privmsg", my_function);}@* +@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{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* +@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* @code{@} }@* @* @item -@command{IRC::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 Perl.@* A fun@,{c}@~ao ser@'a chamada quando o utilizador a invocar utilizando @command{/nome}@* @@ -501,23 +488,41 @@ Este nome pode pertencer a um comando j @end itemize @* @emph{Exemplo:}@* -@code{IRC::add_command_handler ("command", my_command);}@* +@code{weechat::add_command_handler ("command", my_command);}@* @code{sub my_command}@* @code{@{ }@* -@code{@ @ @ @ IRC::print("Argumentos: ".@@_[0]);}@* +@code{@ @ @ @ weechat::print("Argumentos: ".@@_[0]);}@* @code{@ @ @ @ return 0;}@* @code{@} }@* @* @item -@command{IRC::get_info ( [servidor,] nome );}@* +@command{weechat::command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat::get_info ( nome, [servidor] );}@* @* Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@* @emph{Argumentos:} @itemize @minus -@item @option{servidor}: nome interno da servidor @item @option{nome}: nome do info a recuperar: +@item @option{servidor}: nome interno da servidor @itemize @minus @item @option{0 ou version}: comece a vers@~ao de WeeChat @item @option{1 ou nick}: comece o nickname @@ -530,7 +535,7 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@* @* @emph{Exemplos:}@* @code{$version = get_info("version");}@* -@code{$nick = get_info("freenode", "nick");}@* +@code{$nick = get_info("nick", "freenode");}@* @* @end itemize @@ -538,7 +543,166 @@ Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@* @node Scripts Python, Scripts Ruby, Scripts Perl, Extencoes @section Scripts Python -N@~AO DESENVOLVIDO! +@subsection Carregar/Descarregar Scripts Python + +Os Scripts Python s@~ao carregados e descarregados com o comando @command{/python}. +(escreve @kbd{/help python} dentro do WeeChat para obteres ajuda acerca do comando).@* + +@emph{Exemplos:}@* +@itemize @bullet +@item +Carregar um Script Python: @kbd{/python load /tmp/sample.py}@* +@item +Descarregar todos os Scripts Python: @kbd{/python unload}@* +@item +Listar todos os Scripts Python: @kbd{/python}@* +@end itemize + +@subsection Interface WeeChat / Python + +@itemize @bullet +@item +@command{weechat.register ( nome, vers@~ao, fun@,{c}@~ao_de_shutdown, descri@,{c}@~ao );}@* +@* +Esta @'e a primeira fun@,{c}@~ao a invocar num Script Python.@* +Todos os Scripts Python para o Weechat devem invocar esta fun@,{c}@~ao.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{nome}: nome @'unico que indentifique o script (cada Script Python deve ter um @'unico nome) +@item @option{vers@~ao}: vers@~ao do script +@item @option{fun@,{c}@~ao_de_shutdown}: fun@,{c}@~ao Python invocada quando o script é descarregado (par@^ametro opcional, se deixado em branco significa que nada deve ser chamado) +@item @option{descri@,{c}@~ao}: breve descri@,{c}@~ao do script. +@end itemize +@* +@emph{Exemplo:}@* +@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@* +@* + +@item +@command{weechat.prnt ( mensagem, [canal, [servidor]] );}@* +@* +Imprimne uma mensagem na canal.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{mensagem}: mensagem a mostrar +@item @option{canal}: nome da canal +@item @option{servidor}: nome interno da servidor +@end itemize +@* +@emph{Exemplo:}@* +@code{weechat.prnt ("mensagem");}@* +@code{weechat.prnt ("mensagem", "#weechat");}@* +@code{weechat.prnt ("mensagem", "#weechat", "freenode");}@* +@* + +@item +@command{weechat.print_infobar ( atrasa, mensagem );}@* +@* +Imprimne uma mensagem na barra do info.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{atrasa}: depois que isto atrasa (nos segundos), a mensagem estar@'a apagada +(se 0, mensagem n@~ao forem apagados). +@item @option{mensagem}: mensagem a mostrar +@end itemize +@* +@emph{Exemplo:}@* +@code{weechat.print_infobar (5, "mensagem");}@* +@* + +@item +@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.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{nome}: nome da mensagem IRC@* +Para conheceres uma lista de mensagens de IRC, por favor lê o RFC 1459 e/ou o 2812:@* +RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@* +RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt} +@item @option{fun@,{c}@~ao}: fun@,{c}@~ao Python invocada quando a mensagem é recebida +@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{@} }@* +@* + +@item +@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}@* + +@emph{Argumentos:} +@itemize @minus +@item @option{nome}: nome do novo comando@* +Este nome pode pertencer a um comando já existente, o qual ser@'a sobreposto pela fun@,{c}@~ao Python. Tem cuidado quando fizeres isto: os comandos originais não estar@~ao acessiveis antes de teres descarregado o Script Python. +@item @option{fun@,{c}@~ao}: fun@,{c}@~ao Python ligada ao comando +@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{@} }@* +@* + +@item +@command{weechat.command ( command, [channel, [server]] );}@* +@* +Execute a command or send a message to a channel.@* + +@emph{Arguments:} +@itemize @minus +@item @option{command}: command to execute (or message to send in a channel) +@item @option{channel}: name of channel +@item @option{server}: internal name of server +@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");}@* +@* + +@item +@command{weechat.get_info ( nome, [servidor] );}@* +@* +Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@* + +@emph{Argumentos:} +@itemize @minus +@item @option{nome}: nome do info a recuperar: +@item @option{servidor}: nome interno da servidor +@itemize @minus +@item @option{0 ou version}: comece a vers@~ao de WeeChat +@item @option{1 ou nick}: comece o nickname +@item @option{2 ou channel}: comece o nome da canal +@item @option{3 ou server}: comece o nome do servidor +@item @option{4 ou weechatdir}: comece a WeeChat o diret@'orio home +@item @option{5 ou away}: comece a bandeira ausente para o servidor +@end itemize +@end itemize +@* +@emph{Exemplos:}@* +@code{$version = weechat.get_info("version");}@* +@code{$nick = weechat.get_info("nick", "freenode");}@* +@* + +@end itemize @node Scripts Ruby, , Scripts Python, Extencoes @section Scripts Ruby