|
@@ -114,9 +114,10 @@ class Kaylee:
|
114
|
114
|
numt, nums = self.number_parser.parse_all_numbers(t)
|
115
|
115
|
# Is there a matching command?
|
116
|
116
|
if t in self.commands:
|
117
|
|
- # Run the valid_sentence_command if there is a valid sentence command
|
|
117
|
+ # Run the valid_sentence_command if it's set
|
118
|
118
|
if self.options['valid_sentence_command']:
|
119
|
|
- subprocess.call(self.options['valid_sentence_command'], shell=True)
|
|
119
|
+ subprocess.call(self.options['valid_sentence_command'],
|
|
120
|
+ shell=True)
|
120
|
121
|
cmd = self.commands[t]
|
121
|
122
|
# Should we be passing words?
|
122
|
123
|
if self.options['pass_words']:
|
|
@@ -124,9 +125,10 @@ class Kaylee:
|
124
|
125
|
self.run_command(cmd)
|
125
|
126
|
self.log_history(text)
|
126
|
127
|
elif numt in self.commands:
|
127
|
|
- # Run the valid_sentence_command if there is a valid sentence command
|
|
128
|
+ # Run the valid_sentence_command if it's set
|
128
|
129
|
if self.options['valid_sentence_command']:
|
129
|
|
- subprocess.call(self.options['valid_sentence_command'], shell=True)
|
|
130
|
+ subprocess.call(self.options['valid_sentence_command'],
|
|
131
|
+ shell=True)
|
130
|
132
|
cmd = self.commands[numt]
|
131
|
133
|
cmd = cmd.format(*nums)
|
132
|
134
|
# Should we be passing words?
|
|
@@ -135,9 +137,10 @@ class Kaylee:
|
135
|
137
|
self.run_command(cmd)
|
136
|
138
|
self.log_history(text)
|
137
|
139
|
else:
|
138
|
|
- # Run the invalid_sentence_command if there is an invalid sentence command
|
|
140
|
+ # Run the invalid_sentence_command if it's set
|
139
|
141
|
if self.options['invalid_sentence_command']:
|
140
|
|
- subprocess.call(self.options['invalid_sentence_command'], shell=True)
|
|
142
|
+ subprocess.call(self.options['invalid_sentence_command'],
|
|
143
|
+ shell=True)
|
141
|
144
|
print("no matching command {0}".format(t))
|
142
|
145
|
# If there is a UI and we are not continuous listen
|
143
|
146
|
if self.ui:
|