Kamaelia IRC Support CodeThis provides support for Kamaelia.Protocol.IRC.* Specifically it provides 2 core functions and 2 utility methods. Core functionsinformat(text,defaultChannel='#kamtest')Summary - Puts a string input into tuple format for IRC_Client. Understands irc commands preceded by a slash ("/"). All other text is formatted such that sending it would send the message to the default channel. Detail - If the text starts with a "/" it is treated as a command. Informat understands some specific commands which it helps you format for sending to the IRCClient. The commands it understands are: QUIT PRIVMSG MSG NOTICE KILL TOPIC SQUERY KICK USER ME For commands it doesn't recognise, it makes a guess at how to forward it. If you send it text which does NOT start with "/", it is assumed to be badly formatted text, intended to be sent to the current default channel. It is then formatted appropriately for sending on to an IRC_Client component. For an example of usage, see Examples/TCP_Systems/IRC/BasicDemo.py outformat(data, defaultChannel='#kamtest')Takes tuple output from IRC_Client and formats for easier reading If a plaintext is received, outformat treats it as a privmsg intended for defaultChannel (default "#kamtest"). Specific commands it understands and will make a an attempt to format appropriately are: PRIVMSG JOIN PART NICK ACTION TOPIC QUIT MODE It will also identify certain types of errors. For an example of usage, see Examples/TCP_Systems/IRC/BasicDemo.py Utility functionschannelOutformat(channel)Creates a customised outformat function with defaultChannel predefined to channel. (ie Returns a lambda) channelInformat(channel)Creates a customised informat function with defaultChannel predefined to channel. (ie Returns a lambda) Open IssuesShould these really be components rather than helper functions? FeedbackGot a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording! Please leave you feedback here in reply to the documentation thread in the Kamaelia blog. -- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT |
Kamaelia
is an open source project originated from and guided by BBC
Research. For more information browse the site or get in
contact.
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.