mirror of
https://github.com/aidygus/LinVAM.git
synced 2025-01-16 09:48:06 +11:00
allow multiple keywords, separated by colons
This commit is contained in:
parent
a229683c57
commit
d4753faa08
@ -59,12 +59,10 @@ class ProfileExecutor(threading.Thread):
|
|||||||
#print ("writing command list")
|
#print ("writing command list")
|
||||||
w_commandWordFile = open(self.getSettingsPath('command.list'), 'w')
|
w_commandWordFile = open(self.getSettingsPath('command.list'), 'w')
|
||||||
w_commands = self.m_profile['commands']
|
w_commands = self.m_profile['commands']
|
||||||
i = 0
|
|
||||||
for w_command in w_commands:
|
for w_command in w_commands:
|
||||||
if i != 0:
|
parts = w_command['name'].split(',')
|
||||||
w_commandWordFile.write('\n')
|
for part in parts:
|
||||||
w_commandWordFile.write(w_command['name'].lower() + ' /1e-%d/' % w_command['threshold'])
|
w_commandWordFile.write(part.lower() + ' /1e-%d/' % w_command['threshold'] + '\n')
|
||||||
i = i + 1
|
|
||||||
w_commandWordFile.close()
|
w_commandWordFile.close()
|
||||||
self.m_config.set_string('-kws', self.getSettingsPath('command.list'))
|
self.m_config.set_string('-kws', self.getSettingsPath('command.list'))
|
||||||
# load new command list into decoder and restart it
|
# load new command list into decoder and restart it
|
||||||
@ -213,9 +211,18 @@ class ProfileExecutor(threading.Thread):
|
|||||||
w_commands = self.m_profile['commands']
|
w_commands = self.m_profile['commands']
|
||||||
flag = False
|
flag = False
|
||||||
for w_command in w_commands:
|
for w_command in w_commands:
|
||||||
if w_command['name'].lower() == p_cmdName:
|
parts = []
|
||||||
flag = True
|
if w_command['name'].find(',') != -1:
|
||||||
break
|
parts = w_command['name'].split(',')
|
||||||
|
else:
|
||||||
|
parts.append(w_command['name'])
|
||||||
|
|
||||||
|
for part in parts:
|
||||||
|
if part.lower() == p_cmdName:
|
||||||
|
print(part)
|
||||||
|
flag = True
|
||||||
|
break
|
||||||
|
|
||||||
if flag == False:
|
if flag == False:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user