slight documentation and whitespace for subclassing irclib.IRC, irclib.ServerConnection

This commit is contained in:
Brian S. Stephan 2010-07-29 23:26:30 -05:00
parent 331ca77337
commit 88186e1425
1 changed files with 7 additions and 0 deletions

View File

@ -27,13 +27,20 @@ modlist = []
moduleList = [ "Countdown", "Dice", "IrcAdmin", "GoogleTranslate", "Seen", "FactFile" ]
modObjs = []
# DrBotServerConnection subclasses irclib's ServerConnection, in order to expand
# privmsg.
class DrBotServerConnection(irclib.ServerConnection):
def privmsg(self, target, text):
# Send a PRIVMSG command.
# TODO: length limiting or splitting
self.send_raw("PRIVMSG %s :%s" % (target, text))
# DrBotIRC subclasses irclib's IRC, in order to create a DrBotServerConnection.
class DrBotIRC(irclib.IRC):
def server(self):
c = DrBotServerConnection(self)
self.connections.append(c)