From 215f44f9c283caf4e75cc80f16ec62d2bc7af747 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Fri, 23 Sep 2016 09:54:29 +0200 Subject: [PATCH] Update commandManager.py --- src/fenrir-package/core/commandManager.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/fenrir-package/core/commandManager.py b/src/fenrir-package/core/commandManager.py index f3735898..8a04e17e 100644 --- a/src/fenrir-package/core/commandManager.py +++ b/src/fenrir-package/core/commandManager.py @@ -64,16 +64,7 @@ class commandManager(): if self.env['runtime']['screenManager'].isSuspendingScreen(): return #unload - oldScript = '' - if isinstance(unLoadScript, list): - if len(unLoadScript) == 0: - oldScript = 'DEFAULT' - else: - oldScript = unLoadScript[0] - elif unLoadScript: - oldScript = str(unLoadScript) - if oldScript == '': - oldScript == 'DEFAULT' + oldScript = unLoadScript if self.commandExists(oldScript, trigger): try: self.env['commands'][trigger][oldScript].unload() @@ -82,16 +73,7 @@ class commandManager(): self.env['runtime']['debug'].writeDebugOut("Executing trigger:" + trigger + "." + oldScript ,debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) #load - newScript = '' - if isinstance(loadScript, list): - if len(loadScript) == 0: - newScript = 'DEFAULT' - else: - newScript = loadScript[0] - elif unLoadScript: - newScript = str(loadScript) - if newScript == '': - newScript == 'DEFAULT' + newScript = loadScript if self.commandExists(newScript, trigger): try: self.env['commands'][trigger][newScript].load()