|
@@ -159,20 +159,25 @@ class Kaylee:
|
159
|
159
|
|
160
|
160
|
# Give the command to the handlers that want it
|
161
|
161
|
while True:
|
|
162
|
+ # Get information about the handler
|
162
|
163
|
try:
|
163
|
|
- # Get information about the handler
|
164
|
164
|
info = confidence_heap.get_nowait()
|
165
|
|
- handler = info[0]
|
166
|
|
- plugin = info[2]
|
167
|
|
- # Handle the command
|
168
|
|
- handler(self.plugin_tts)
|
169
|
|
- self._log_history(plugin, text)
|
170
|
|
- break
|
171
|
165
|
except queue.Empty:
|
|
166
|
+ # If the queue is empty, we have nothing else to try, so break
|
172
|
167
|
break
|
|
168
|
+ handler = info[0]
|
|
169
|
+ plugin = info[2]
|
|
170
|
+
|
|
171
|
+ # Handle the command
|
|
172
|
+ try:
|
|
173
|
+ handler(self.plugin_tts)
|
173
|
174
|
except kayleevc.plugins.HandlerFailure:
|
174
|
175
|
# If the handler failed, keep trying
|
175
|
176
|
continue
|
|
177
|
+ else:
|
|
178
|
+ # If the handler succeeded, log it and break
|
|
179
|
+ self._log_history(plugin, text)
|
|
180
|
+ break
|
176
|
181
|
|
177
|
182
|
self._stop_ui(text)
|
178
|
183
|
|