Package circuits :: Package net :: Package protocols :: Module irc :: Class IRC

Class IRC

    object --+            
             |            
  core.Manager --+        
                 |        
core.BaseComponent --+    
                     |    
        core.Component --+
                         |
                        IRC

IRC Protocol Component

Creates a new IRC Component instance that implements the IRC Protocol. Incoming messages are handled by the "read" Event Handler, parsed and processed with appropriate Events created and exposed to the rest of te system to listen to and handle.


Note: This Component must be used in conjunction with a Component that exposes Read Events on a "read" Channel.

Nested Classes

Inherited from core.Component: __metaclass__

Instance Methods
 
__init__(self, *args, **kwargs)
initializes x; see x.__class__.__doc__ for signature
str
getNick(I)
Return the current nickname if set, return None otherwise.
str
getIdent(I)
Return the current ident if set, return None otherwise.
str
getHost(I)
Return the current host if set, return None otherwise.
str
getServer(I)
Return the current server if set, return None otherwise.
str
getServerVersion(I)
Return the current server version if set, return None otherwise.
str
getNetwork(I)
Return the current network if set, return None otherwise.
str
getName(I)
Return the current name if set, return None otherwise.
 
RAW(self, data)
 
PASS(self, password)
 
SERVER(self, server, hops, token, description)
 
USER(self, ident, host, server, name)
 
NICK(self, nick, idle=None, signon=None, ident=None, host=None, server=None, hops=None, name=None)
 
PING(self, server)
 
PONG(self, server)
 
QUIT(self, message='', source=None)
 
JOIN(self, channel, key=None, source=None)
 
PART(self, channel, message='', source=None)
 
PRIVMSG(self, target, message, source=None)
 
NOTICE(self, target, message, source=None)
 
CTCP(self, target, type, message, source=None)
 
CTCPREPLY(self, target, type, message, source=None)
 
KICK(self, channel, target, message='', source=None)
 
TOPIC(self, channel, topic, whoset=None, whenset=None, source=None)
 
MODE(self, modes, channel=None, source=None)
 
KILL(self, target, message)
 
INVITE(self, target, channel, source=None)
 
NAMES(self, channel=None)
 
read(self, data)
Read Event Handler
None
raw(I, line)
Process a line of text and generate the appropiate event.
 
ping(self, server)
Ping Event

Inherited from core.BaseComponent: __repr__, register, unregister

Inherited from core.Manager: __add__, __iadd__, __isub__, __len__, __sub__, flush, join, push, run, send, start, stop

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __str__

Static Methods

Inherited from core.Component: __new__

Instance Variables

Inherited from core.BaseComponent: channel

Inherited from core.Manager: manager

Properties
  nick
I.getNick() -> str

Inherited from core.Manager: name, running, state

Inherited from object: __class__

Method Details

__init__(self, *args, **kwargs)
(Constructor)

 

initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

read(self, data)

 

Read Event Handler

Process any incoming data appending it to an internal buffer. Split the buffer by the standard IRC delimiter CRLF and create a Raw event per line. Any unfinished lines of text, leave in the buffer.

raw(I, line)

 

Process a line of text and generate the appropiate event. This must not be overridden by sub-classes, if it is, this must be explitetly called by the sub-class. Other Components may however listen to this event and process custom IRC events.

Returns: None

ping(self, server)

 

Ping Event

This is a default event ro respond to Ping Events by sending out a Pong in response. Sub-classes may override this, but be sure to respond to Ping Events by either explitetly calling this method or sending your own Pong reponse.


Property Details

nick

I.getNick() -> str

Return the current nickname if set, return None otherwise.

Get Method:
getNick(I) - Return the current nickname if set, return None otherwise.
Set Method:
NICK(self, nick, idle=None, signon=None, ident=None, host=None, server=None, hops=None, name=None)