add_global_handler() for pubmsg and privmsg by default, since Module defines on_pubmsg/on_privmsg anyway, and that's been the default for almost every module so far

This commit is contained in:
Brian S. Stephan 2010-07-30 18:50:56 -05:00
parent 7feb90242d
commit eb1efa4919
6 changed files with 2 additions and 21 deletions

View File

@ -60,7 +60,8 @@ class Module(object):
own.
"""
print "looks like someone forgot to implement register_handlers!"
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)
def unregister_handlers(self):
"""

View File

@ -28,10 +28,6 @@ from Module import Module
class Countdown(Module):
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)
def unregister_handlers(self):
self.server.remove_global_handler('pubmsg', self.on_pubmsg)
self.server.remove_global_handler('privmsg', self.on_privmsg)

View File

@ -25,10 +25,6 @@ from Module import Module
class Dice(Module):
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)
def unregister_handlers(self):
self.server.remove_global_handler('pubmsg', self.on_pubmsg)
self.server.remove_global_handler('privmsg', self.on_privmsg)

View File

@ -27,10 +27,6 @@ from Module import Module
class FactFile(Module):
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)
def unregister_handlers(self):
self.server.remove_global_handler('pubmsg', self.on_pubmsg)
self.server.remove_global_handler('privmsg', self.on_privmsg)

View File

@ -27,10 +27,6 @@ from Module import Module
class GoogleTranslate(Module):
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)
def unregister_handlers(self):
self.server.remove_global_handler('pubmsg', self.on_pubmsg)
self.server.remove_global_handler('privmsg', self.on_privmsg)

View File

@ -28,10 +28,6 @@ from Module import Module
class Seen(Module):
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)
def unregister_handlers(self):
self.server.remove_global_handler('pubmsg', self.on_pubmsg)
self.server.remove_global_handler('privmsg', self.on_privmsg)