diff options
| author | 2018-10-12 18:07:23 +0100 | |
|---|---|---|
| committer | 2018-10-12 18:07:23 +0100 | |
| commit | 819f4e0680dc8225355924e87bc71938605b98f7 (patch) | |
| tree | 435f17eccda20a1723f51330ee0403668c76afcd /modules/scripts.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/scripts.py')
| -rw-r--r-- | modules/scripts.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/scripts.py b/modules/scripts.py index 0c4ccb25..ae158546 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -1,11 +1,10 @@ import glob, json, os, subprocess -from src import IRCObject, utils +from src import IRCObject, ModuleManager, utils -class Module(object): - def __init__(self, bot, events, exports): - self.events = events - self._directory = os.path.join(bot.directory, "modules", "scripts") +class Module(ModuleManager.BaseModule): + def on_load(self): + self._directory = os.path.join(self.bot.directory, "modules", "scripts") self._hooks = [] self._load_scripts() |
