From 88186e14257d035ef92fdee6af251552646c15db Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 29 Jul 2010 23:26:30 -0500 Subject: [PATCH] slight documentation and whitespace for subclassing irclib.IRC, irclib.ServerConnection --- dr.botzo.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dr.botzo.py b/dr.botzo.py index e705886..e50f500 100644 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -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)