remove unneded return value from commandManager

This commit is contained in:
chrys 2016-09-17 17:54:49 +02:00
parent 515e3b0f7b
commit 87a2b5bfc1

View File

@ -10,9 +10,9 @@ class commandManager():
environment['runtime']['commandManager'].loadCommands(environment,'commands') environment['runtime']['commandManager'].loadCommands(environment,'commands')
environment['runtime']['commandManager'].loadCommands(environment,'onInput') environment['runtime']['commandManager'].loadCommands(environment,'onInput')
environment['runtime']['commandManager'].loadCommands(environment,'onScreenChanged') environment['runtime']['commandManager'].loadCommands(environment,'onScreenChanged')
return environment
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def loadCommands(self, environment, section='commands'): def loadCommands(self, environment, section='commands'):
commandFolder = "commands/" + section +"/" commandFolder = "commands/" + section +"/"
commandList = glob.glob(commandFolder+'*') commandList = glob.glob(commandFolder+'*')
@ -33,7 +33,6 @@ class commandManager():
environment['runtime']['debug'].writeDebugOut(environment,"Error while loading command:" + command ,debug.debugLevel.ERROR) environment['runtime']['debug'].writeDebugOut(environment,"Error while loading command:" + command ,debug.debugLevel.ERROR)
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR) environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
continue continue
return environment
def executeTriggerCommands(self, environment, trigger): def executeTriggerCommands(self, environment, trigger):
if environment['runtime']['screenManager'].isSuspendingScreen(environment): if environment['runtime']['screenManager'].isSuspendingScreen(environment):
@ -46,7 +45,6 @@ class commandManager():
print(e) print(e)
environment['runtime']['debug'].writeDebugOut(environment,"Error while executing trigger:" + trigger + "." + cmd ,debug.debugLevel.ERROR) environment['runtime']['debug'].writeDebugOut(environment,"Error while executing trigger:" + trigger + "." + cmd ,debug.debugLevel.ERROR)
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR) environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
return environment
def executeCommand(self, environment, command, section = 'commands'): def executeCommand(self, environment, command, section = 'commands'):
if environment['runtime']['screenManager'].isSuspendingScreen(environment) : if environment['runtime']['screenManager'].isSuspendingScreen(environment) :
@ -62,16 +60,17 @@ class commandManager():
print(e) print(e)
environment['runtime']['debug'].writeDebugOut(environment,"Error while executing command:" + section + "." + command ,debug.debugLevel.ERROR) environment['runtime']['debug'].writeDebugOut(environment,"Error while executing command:" + section + "." + command ,debug.debugLevel.ERROR)
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR) environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
environment['commandInfo']['currCommand'] = '' self.clearCommandQueued(environment)
environment['commandInfo']['lastCommandExecutionTime'] = time.time() environment['commandInfo']['lastCommandExecutionTime'] = time.time()
return environment
def isCommandQueued(self, environment): def isCommandQueued(self, environment):
return environment['commandInfo']['currCommand'] != '' return environment['commandInfo']['currCommand'] != ''
def clearCommandQueued(self, environment):
environment['commandInfo']['currCommand'] = ''
def queueCommand(self, environment, command): def queueCommand(self, environment, command):
environment['commandInfo']['currCommand'] = command environment['commandInfo']['currCommand'] = command
return environment
def commandExists(self, environment, command, section = 'commands'): def commandExists(self, environment, command, section = 'commands'):
return( command.upper() in environment['commands'][section]) return( command.upper() in environment['commands'][section])