explicit break on None and dont run speech if nothing in hotwords
This commit is contained in:
@@ -108,7 +108,7 @@ class Parser(threading.Thread):
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
clip = self.inq.get()
|
clip = self.inq.get()
|
||||||
if not clip:
|
if clip is None:
|
||||||
break
|
break
|
||||||
self.outq.put(self._run(clip).strip())
|
self.outq.put(self._run(clip).strip())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -222,7 +222,6 @@ class Reactor(threading.Thread):
|
|||||||
if environ.get("DEBUG", None):
|
if environ.get("DEBUG", None):
|
||||||
log(f"seeking {hotwords} in {text}")
|
log(f"seeking {hotwords} in {text}")
|
||||||
if not hotwords:
|
if not hotwords:
|
||||||
self.outq.put(("", text))
|
|
||||||
return
|
return
|
||||||
cleantext = "".join([i for i in "".join(text.lower().split()) if i.isalpha()])
|
cleantext = "".join([i for i in "".join(text.lower().split()) if i.isalpha()])
|
||||||
for i in hotwords:
|
for i in hotwords:
|
||||||
|
|||||||
Reference in New Issue
Block a user