For the modules/__init__.py, fixes from Issue #792

proposed by @userclandestine
This commit is contained in:
Alexandre Magno 2013-04-24 05:51:58 -03:00
parent af1c84d6ac
commit 186db8766c
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'''