Update commandManager.py

This commit is contained in:
chrys87 2016-09-23 09:54:29 +02:00 committed by GitHub
parent f1434be12b
commit 215f44f9c2

View File

@ -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()