IRCclient Module

./IRCclient.py [HOST PORT [OPTIONS]] | -z [OPTIONS]

Create a socket on HOST at PORT, and run it a client socket.

Options:

  • -i, –interactive, -z, –zenity Force Zenity interactivity : read args HOST and PORT interactively.

    with Zenity and PyZenity (don’t use it unless you are sure to have both).

  • -ni, --non-interactive
     

    Disable Zenity interactivity : read args HOST and PORT from command line, Default.

  • -w

    Print << in beginning of every output (experimental).

  • -v

    Be verbous (print usefull informations about connections).

  • -h, --help

    Print this help message.

  • -a

    Print all message incomming from the client or outcomming to the server.

  • –debug Launch program in debug mod with pygdb.

Example:

$ ./PyRlwrap.py ./IRCclient.py naereen-corp.crans.org 9312 -v -a

Copyrigths:

  1. 09/2012
By Lilian BESSON
ENS de Cachan (M1 Mathematics & M1 Computer Science MPRI) mailto:lbesson@ens-cachan.fr
For Naereen Corp.
mailto:naereen-corporation@laposte.net https:sites.google.com/site/naereencorp/liste-des-projets/irc.
IRCclient.ColorOff(verb=False)[source]

Turn off the support of ANSI Colors. Can be used other somewhere else, or on other modules, AFTER importing ANSIColors module !

IRCclient.ColorOn(verb=False)[source]

Turn on the support of ANSI Colors. Can be used other somewhere else, or on other modules, AFTER importing ANSIColors module !

IRCclient.kwargs = {'window-icon': 'server', 'title': 'IRC server'}

Args for all Zenity call

IRCclient.exit_with_Zenity(msg_erreur)[source]

A remplacement for sys.exit : print an error message with Zenity before executing sys.exit.

IRCclient.PRINT_ALL_MESSAGE = 1

1 to print messages

IRCclient.WRAPPER_PRINTED = 0

1 to print >> and << in output and input.

IRCclient.create_socket_client(server=('0.0.0.0', 12882))[source]

Create a socket designed to be a client, and connect it to @server. Return a socket.

IRCclient.WRAPPER_IN = ''

Piece of text to be printed before each input

IRCclient.WRAPPER_OUT = '<< '

Piece of text to be printed before each output.

IRCclient.help_User = '\nWelcome in IRC client v0.93.\n\tWrote by Lilian BESSON (mailto:lilian.besson@normale.fr), last version dated of jeudi 07 02 2013, at 23h:17m:30s.\n\nYour are connected to a local IRC server using UDP sockets.\nAll messages enter from here will be broadcasted to all other connected clients, and here are broadcasted all messages from other clients.\n\nThe following commands are enabled :\n\t\\h, \\help, \\? : print this help,\n\t\\out : logout violently (not like Ctrl+D or Ctrl+C).\n'

The help message, which can be printed to the user when invoking ‘\?’

IRCclient.action_on_readstr(readstr)[source]

Reaction to special message readed from the keyboard !

IRCclient.run_client(msocket, server, PRINT_ALL_MESSAGE=1, WRAPPER_PRINTED=0)[source]

An infinite loop over the @msocket, which have to be a client socket assumed te be connected with @server (just used to print some usefull informations). Concurrently, read from stdin on client and write on stdout on server, and read on stdin on server and write on stdout on client. Use thread.

DEBUG, PRINT_ALL_MESSAGE, WRAPPER_PRINTED: are options for parametrize behaviour of client.

IRCclient.HELP = "./IRCclient.py [HOST PORT [OPTIONS]] | -z [OPTIONS]\n\nCreate a socket on HOST at PORT, and run it a client socket.\n\nOptions:\n========\n *\t-i, --interactive, -z, --zenity\t\n\tForce Zenity interactivity : read args HOST and PORT interactively.\n\t\t with Zenity and PyZenity (don't use it unless you are sure to have both).\n *\t-ni, --non-interactive\tDisable Zenity interactivity : read args HOST and PORT from command line, Default.\n *\t-w\tPrint << in beginning of every output (experimental).\n *\t-v\tBe verbous (print usefull informations about connections).\n *\t-h, --help\tPrint this help message.\n *\t-a\tPrint all message incomming from the client or outcomming to the server.\n *\t--debug\tLaunch program in debug mod with pygdb.\n\nExample:\n========\n\t$ ./PyRlwrap.py ./IRCclient.py naereen-corp.crans.org 9312 -v -a\n\nCopyrigths:\n===========\n (c) 09/2012\n By Lilian BESSON\n ENS de Cachan (M1 Mathematics & M1 Computer Science MPRI)\n mailto:lbesson@ens-cachan.fr\n \n For Naereen Corp.\n mailto:naereen-corporation@laposte.net\n https:sites.google.com/site/naereencorp/liste-des-projets/irc.\n"

Help message for this program or this module (Keep in mind that it’s mainly designed to be a program, called from the command line)

IRCclient.main(args, HOST='0.0.0.0', PORT=12882)[source]

Create a socket on an host=args[1] with port=int(args[2]), and run a client on it.

IRCclient.ask_arg(HOST, PORT)[source]

Use PyZenity to ask interactivly the arguments of the program.

Table Of Contents

Previous topic

ToolReadline Module

Next topic

IRCserver Module

This Page