make code more short, remove unneded sleeps

This commit is contained in:
chrys 2017-02-26 14:52:38 +01:00
parent 21e7f68235
commit 7a41c015a8
2 changed files with 10 additions and 29 deletions

View File

@ -15,38 +15,17 @@ class commandManager():
def initialize(self, environment):
self.env = environment
# commands
self.env['runtime']['commandManager'].loadCommands('commands',
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
self.env['runtime']['commandManager'].loadCommands('commands')
# onInput
self.env['runtime']['commandManager'].loadCommands('onInput',
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
self.env['runtime']['commandManager'].loadCommands('onInput')
# onScreenUpdate
self.env['runtime']['commandManager'].loadCommands('onScreenUpdate',
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
self.env['runtime']['commandManager'].loadCommands('onScreenUpdate')
# onScreenChanged
self.env['runtime']['commandManager'].loadCommands('onScreenChanged',
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
self.env['runtime']['commandManager'].loadCommands('onScreenChanged')
# onApplicationChange
self.env['runtime']['commandManager'].loadCommands('onApplicationChange',
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
self.env['runtime']['commandManager'].loadCommands('onApplicationChange')
# onSwitchApplicationProfile
self.env['runtime']['commandManager'].loadCommands('onSwitchApplicationProfile',
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
self.env['runtime']['commandManager'].loadCommands('onSwitchApplicationProfile')
for commandFolder in self.env['generalInformation']['commandFolderList']:
self.env['runtime']['commandManager'].loadCommands(commandFolder,
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
self.env['runtime']['commandManager'].loadCommands(commandFolder)
# scripts for scriptKey
self.env['runtime']['commandManager'].loadScriptCommands()
def shutdown(self):
self.env['runtime']['commandManager'].shutdownCommands('commands')
self.env['runtime']['commandManager'].shutdownCommands('onInput')
self.env['runtime']['commandManager'].shutdownCommands('onScreenUpdate')
self.env['runtime']['commandManager'].shutdownCommands('onScreenChanged')
self.env['runtime']['commandManager'].shutdownCommands('onApplicationChange')
self.env['runtime']['commandManager'].shutdownCommands('onSwitchApplicationProfile')
for commandFolder in self.env['generalInformation']['commandFolderList']:
self.env['runtime']['commandManager'].shutdownCommands(commandFolder)
def loadCommands(self, section='commands',commandPath=''):
if commandPath =='':

View File

@ -13,4 +13,6 @@ generalInformation = {
'prevUser':'',
'managerList':['inputManager','screenManager','commandManager','outputManager'
,'punctuationManager','cursorManager','applicationManager','debug'],
'commandFolderList':['commands','onInput','onScreenUpdate','onScreenChanged'
,'onApplicationChange','onSwitchApplicationProfile',],
}