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:
parent
262ee2e3e1
commit
5ba26107cc
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user