From 186db8766c0cd535a4c92881a90cffd64db3acd2 Mon Sep 17 00:00:00 2001 From: Alexandre Magno Date: Wed, 24 Apr 2013 05:51:58 -0300 Subject: [PATCH] For the modules/__init__.py, fixes from Issue #792 proposed by @userclandestine --- kivy/modules/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kivy/modules/__init__.py b/kivy/modules/__init__.py index 9e6d5b9ce..376dd4a09 100644 --- a/kivy/modules/__init__.py +++ b/kivy/modules/__init__.py @@ -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'''