make code more short, remove unneded sleeps
This commit is contained in:
parent
21e7f68235
commit
7a41c015a8
@ -15,38 +15,17 @@ class commandManager():
|
|||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
# commands
|
# commands
|
||||||
self.env['runtime']['commandManager'].loadCommands('commands',
|
for commandFolder in self.env['generalInformation']['commandFolderList']:
|
||||||
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
self.env['runtime']['commandManager'].loadCommands(commandFolder,
|
||||||
self.env['runtime']['commandManager'].loadCommands('commands')
|
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
||||||
# onInput
|
self.env['runtime']['commandManager'].loadCommands(commandFolder)
|
||||||
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')
|
|
||||||
# scripts for scriptKey
|
# scripts for scriptKey
|
||||||
self.env['runtime']['commandManager'].loadScriptCommands()
|
self.env['runtime']['commandManager'].loadScriptCommands()
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
self.env['runtime']['commandManager'].shutdownCommands('commands')
|
for commandFolder in self.env['generalInformation']['commandFolderList']:
|
||||||
self.env['runtime']['commandManager'].shutdownCommands('onInput')
|
self.env['runtime']['commandManager'].shutdownCommands(commandFolder)
|
||||||
self.env['runtime']['commandManager'].shutdownCommands('onScreenUpdate')
|
|
||||||
self.env['runtime']['commandManager'].shutdownCommands('onScreenChanged')
|
|
||||||
self.env['runtime']['commandManager'].shutdownCommands('onApplicationChange')
|
|
||||||
self.env['runtime']['commandManager'].shutdownCommands('onSwitchApplicationProfile')
|
|
||||||
|
|
||||||
def loadCommands(self, section='commands',commandPath=''):
|
def loadCommands(self, section='commands',commandPath=''):
|
||||||
if commandPath =='':
|
if commandPath =='':
|
||||||
|
@ -13,4 +13,6 @@ generalInformation = {
|
|||||||
'prevUser':'',
|
'prevUser':'',
|
||||||
'managerList':['inputManager','screenManager','commandManager','outputManager'
|
'managerList':['inputManager','screenManager','commandManager','outputManager'
|
||||||
,'punctuationManager','cursorManager','applicationManager','debug'],
|
,'punctuationManager','cursorManager','applicationManager','debug'],
|
||||||
|
'commandFolderList':['commands','onInput','onScreenUpdate','onScreenChanged'
|
||||||
|
,'onApplicationChange','onSwitchApplicationProfile',],
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user