Merge pull request #1138 from alexandre-mbm/modules-study_and_test

For the modules/__init__.py, fixes from Issue #792
This commit is contained in:
Mathieu Virbel 2013-04-30 08:17:22 -07:00
commit 1be3f52cf9
1 changed files with 4 additions and 1 deletions

View File

@ -147,17 +147,20 @@ class ModuleBase:
name, context)
Logger.debug(msg)
module.start(win, context)
self.mods[name]['activated'] = True
def deactivate_module(self, name, win):
'''Deactivate a module from a window'''
if not name in self.mods:
Logger.warning('Modules: Module <%s> not found' % name)
return
if not hasattr(self.mods[name], 'module'):
if not 'module' in self.mods[name]:
return
module = self.mods[name]['module']
if self.mods[name]['activated']:
module.stop(win, self.mods[name]['context'])
self.mods[name]['activated'] = False
def register_window(self, win):
'''Add window in window list'''