each module subclassing Module unnecessarily defined __init__, with the exception of IrcAdmin, whose SIGINT setup was moved to register_handlers

This commit is contained in:
Brian S. Stephan 2010-07-30 14:38:28 -05:00
parent 262ee2e3e1
commit 5ba26107cc
6 changed files with 3 additions and 27 deletions

View File

@ -28,10 +28,6 @@ from Module import Module
class Countdown(Module):
def __init__(self, config, server, modlist):
super(Countdown, self).__init__(config, server, modlist)
modlist.append(self)
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)

View File

@ -25,10 +25,6 @@ from Module import Module
class Dice(Module):
def __init__(self, config, server, modlist):
super(Dice, self).__init__(config, server, modlist)
modlist.append(self)
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)

View File

@ -27,10 +27,6 @@ from Module import Module
class FactFile(Module):
def __init__(self, config, server, modlist):
super(FactFile, self).__init__(config, server, modlist)
modlist.append(self)
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)

View File

@ -27,10 +27,6 @@ from Module import Module
class GoogleTranslate(Module):
def __init__(self, config, server, modlist):
super(GoogleTranslate, self).__init__(config, server, modlist)
modlist.append(self)
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)

View File

@ -26,18 +26,14 @@ from Module import Module
class IrcAdmin(Module):
def __init__(self, config, server, modlist):
super(IrcAdmin, self).__init__(config, server, modlist)
modlist.append(self)
# we define save, so we'll bite the bullet and take SIGINT
signal.signal(signal.SIGINT, self.sigint_handler)
def register_handlers(self, server):
server.add_global_handler('welcome', self.on_connect)
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)
# we define save, so we'll bite the bullet and take SIGINT
signal.signal(signal.SIGINT, self.sigint_handler)
def unregister_handlers(self):
self.server.remove_global_handler('welcome', self.on_connect)
self.server.remove_global_handler('pubmsg', self.on_pubmsg)

View File

@ -28,10 +28,6 @@ from Module import Module
class Seen(Module):
def __init__(self, config, server, modlist):
super(Seen, self).__init__(config, server, modlist)
modlist.append(self)
def register_handlers(self, server):
server.add_global_handler('pubmsg', self.on_pubmsg)
server.add_global_handler('privmsg', self.on_privmsg)