diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-05-02 21:18:09 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-05-02 21:19:21 +0200 |
commit | d537d4b69b4547814f2d01bc18ce2c472b978647 (patch) | |
tree | 444f07b95e0e2333f9d5d264a8917dfbd7230f6a /curunir.py | |
parent | 0277a779c9dff841e04a08a5c39fe07faa92cfe8 (diff) | |
download | curunir-d537d4b69b4547814f2d01bc18ce2c472b978647.tar curunir-d537d4b69b4547814f2d01bc18ce2c472b978647.zip |
Added log module
Diffstat (limited to 'curunir.py')
-rw-r--r-- | curunir.py | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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 |