summaryrefslogtreecommitdiffstats
path: root/curunir.py
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-05-02 21:18:09 +0200
committerMatthias Schiffer <matthias@gamezock.de>2010-05-02 21:19:21 +0200
commitd537d4b69b4547814f2d01bc18ce2c472b978647 (patch)
tree444f07b95e0e2333f9d5d264a8917dfbd7230f6a /curunir.py
parent0277a779c9dff841e04a08a5c39fe07faa92cfe8 (diff)
downloadcurunir-d537d4b69b4547814f2d01bc18ce2c472b978647.tar
curunir-d537d4b69b4547814f2d01bc18ce2c472b978647.zip
Added log module
Diffstat (limited to 'curunir.py')
-rw-r--r--curunir.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/curunir.py b/curunir.py
index 7f6a699..99fd77f 100644
--- a/curunir.py
+++ b/curunir.py
@@ -6,14 +6,18 @@ from config import config
class ModuleManager:
def __init__(self, config):
self.config = config
- self.modules = []
+ self.modules = {}
for mod in config['modules']:
- self.load(mod)
+ self.get(mod)
- def load(self, name):
- mod = __import__('modules.' + name, globals(), locals(), ['Module'])
- self.modules.append(mod.Module(self))
+ def get(self, name):
+ if not name in self.modules:
+ mod = __import__('modules.' + name, globals(), locals(), ['Module'])
+ self.modules[name] = mod.Module(self)
+
+ return self.modules[name]
+
run = True