Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions profileexecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ def setProfile(self, p_profile):
#print ("writing command list")
w_commandWordFile = open(self.getSettingsPath('command.list'), 'w')
w_commands = self.m_profile['commands']
i = 0
for w_command in w_commands:
if i != 0:
w_commandWordFile.write('\n')
w_commandWordFile.write(w_command['name'].lower() + ' /1e-%d/' % w_command['threshold'])
i = i + 1
parts = w_command['name'].split(',')
for part in parts:
w_commandWordFile.write(part.lower() + ' /1e-%d/' % w_command['threshold'] + '\n')
w_commandWordFile.close()
self.m_config.set_string('-kws', self.getSettingsPath('command.list'))
# load new command list into decoder and restart it
Expand Down Expand Up @@ -213,9 +211,14 @@ def doCommand(self, p_cmdName):
w_commands = self.m_profile['commands']
flag = False
for w_command in w_commands:
if w_command['name'].lower() == p_cmdName:
flag = True
parts = w_command['name'].split(',')
for part in parts:
if part.lower() == p_cmdName:
flag = True
break
if flag == True:
break

if flag == False:
return

Expand Down