teehee
parent
6ce38738f5
commit
96585d4787
|
|
@ -147,7 +147,7 @@ class Reactor(threading.Thread):
|
|||
cleantext = "".join([i for i in "".join(text.lower().split()) if i.isalpha()])
|
||||
for i in hotwords:
|
||||
if i in cleantext:
|
||||
log(f"Reactor.handle: found hotword '{i}' in '{text}' as '{cleantext}'")
|
||||
#log(f"Reactor.handle: found hotword '{i}' in '{text}' as '{cleantext}'")
|
||||
self.outq.put((i, text))
|
||||
|
||||
class Actor(threading.Thread):
|
||||
|
|
@ -158,14 +158,14 @@ class Actor(threading.Thread):
|
|||
def run(self):
|
||||
log("Actor.run: start")
|
||||
while True:
|
||||
hotword, context = self.inq.get()
|
||||
if hotword is None:
|
||||
got = self.inq.get()
|
||||
if got is None:
|
||||
break
|
||||
self.handle(hotword, context)
|
||||
self.handle(got[0], got[1])
|
||||
log("Actor.run: stop")
|
||||
|
||||
def handle(self, hotword, context):
|
||||
print(f'{hotword} in {context}')
|
||||
print(f"'{hotword}' in '{context}'")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
Loading…
Reference in New Issue