aboutsummaryrefslogtreecommitdiff
path: root/modules/scripts.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-12 18:07:23 +0100
committerGravatar jesopo2018-10-12 18:07:23 +0100
commit819f4e0680dc8225355924e87bc71938605b98f7 (patch)
tree435f17eccda20a1723f51330ee0403668c76afcd /modules/scripts.py
parentAdd 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.py9
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()