Update commandManager.py
This commit is contained in:
parent
a8772f7699
commit
826602831b
@ -14,24 +14,31 @@ class commandManager():
|
|||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.env['runtime']['commandManager'].loadCommands('commands')
|
# commands
|
||||||
self.env['runtime']['commandManager'].loadCommands('commands',
|
self.env['runtime']['commandManager'].loadCommands('commands',
|
||||||
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
||||||
self.env['runtime']['commandManager'].loadCommands('onInput')
|
self.env['runtime']['commandManager'].loadCommands('commands')
|
||||||
|
# onInput
|
||||||
self.env['runtime']['commandManager'].loadCommands('onInput',
|
self.env['runtime']['commandManager'].loadCommands('onInput',
|
||||||
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
||||||
self.env['runtime']['commandManager'].loadCommands('onScreenUpdate')
|
self.env['runtime']['commandManager'].loadCommands('onInput')
|
||||||
|
# onScreenUpdate
|
||||||
self.env['runtime']['commandManager'].loadCommands('onScreenUpdate',
|
self.env['runtime']['commandManager'].loadCommands('onScreenUpdate',
|
||||||
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
||||||
self.env['runtime']['commandManager'].loadCommands('onScreenChanged')
|
self.env['runtime']['commandManager'].loadCommands('onScreenUpdate')
|
||||||
|
# onScreenChanged
|
||||||
self.env['runtime']['commandManager'].loadCommands('onScreenChanged',
|
self.env['runtime']['commandManager'].loadCommands('onScreenChanged',
|
||||||
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
||||||
self.env['runtime']['commandManager'].loadCommands('onApplicationChange')
|
self.env['runtime']['commandManager'].loadCommands('onScreenChanged')
|
||||||
|
# onApplicationChange
|
||||||
self.env['runtime']['commandManager'].loadCommands('onApplicationChange',
|
self.env['runtime']['commandManager'].loadCommands('onApplicationChange',
|
||||||
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
||||||
self.env['runtime']['commandManager'].loadCommands('onSwitchApplicationProfile')
|
self.env['runtime']['commandManager'].loadCommands('onApplicationChange')
|
||||||
|
# onSwitchApplicationProfile
|
||||||
self.env['runtime']['commandManager'].loadCommands('onSwitchApplicationProfile',
|
self.env['runtime']['commandManager'].loadCommands('onSwitchApplicationProfile',
|
||||||
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
||||||
|
self.env['runtime']['commandManager'].loadCommands('onSwitchApplicationProfile')
|
||||||
|
# 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')
|
self.env['runtime']['commandManager'].shutdownCommands('commands')
|
||||||
@ -63,6 +70,8 @@ class commandManager():
|
|||||||
fileName = fileName.split('/')[-1]
|
fileName = fileName.split('/')[-1]
|
||||||
if fileName.startswith('__'):
|
if fileName.startswith('__'):
|
||||||
continue
|
continue
|
||||||
|
if self.env['commands'][section][fileName.upper()]:
|
||||||
|
continue
|
||||||
if fileExtension.lower() == '.py':
|
if fileExtension.lower() == '.py':
|
||||||
command_mod = module_utils.importModule(fileName, command)
|
command_mod = module_utils.importModule(fileName, command)
|
||||||
self.env['commands'][section][fileName.upper()] = command_mod.command()
|
self.env['commands'][section][fileName.upper()] = command_mod.command()
|
||||||
@ -101,6 +110,8 @@ class commandManager():
|
|||||||
fileName = fileName.split('/')[-1]
|
fileName = fileName.split('/')[-1]
|
||||||
if fileName.startswith('__'):
|
if fileName.startswith('__'):
|
||||||
continue
|
continue
|
||||||
|
if self.env['commands'][section][fileName.upper()]:
|
||||||
|
continue
|
||||||
command_mod = module_utils.importModule(fileName ,subCommand)
|
command_mod = module_utils.importModule(fileName ,subCommand)
|
||||||
self.env['commands'][section][fileName.upper()] = command_mod.command()
|
self.env['commands'][section][fileName.upper()] = command_mod.command()
|
||||||
self.env['commands'][section][fileName.upper()].initialize(self.env,command)
|
self.env['commands'][section][fileName.upper()].initialize(self.env,command)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user