diff options
| author | 2018-10-12 18:07:23 +0100 | |
|---|---|---|
| committer | 2018-10-12 18:07:23 +0100 | |
| commit | 819f4e0680dc8225355924e87bc71938605b98f7 (patch) | |
| tree | 435f17eccda20a1723f51330ee0403668c76afcd /modules/signals.py | |
| parent | Add TimersContext, to be able to purge timers when modules are unloaded (diff) | |
| signature | ||
Pass context-wrapped timers to each module, add ModuleManager.BaseModule.on_load
Diffstat (limited to 'modules/signals.py')
| -rw-r--r-- | modules/signals.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/signals.py b/modules/signals.py index 8e57a9a0..627becfe 100644 --- a/modules/signals.py +++ b/modules/signals.py @@ -1,13 +1,11 @@ import signal -from src import Config, utils +from src import Config, ModuleManager, utils @utils.export("serverset", {"setting": "quit-quote", "help": "Set whether I pick a random quote to /quit with", "validate": utils.bool_or_none}) -class Module(object): - def __init__(self, bot, events, exports): - self.bot = bot - self.events = events +class Module(ModuleManager.BaseModule): + def on_load(self): signal.signal(signal.SIGINT, self.SIGINT) signal.signal(signal.SIGUSR1, self.SIGUSR1) |
