Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Update to pyee 8.1.0
Browse files Browse the repository at this point in the history
pyee 8.1.0 adds a small change to make the once call to be more safe in
multithreaded environments.

This switches back from the now deprecated BaseEventEmitter to the
standard EventEmitter.
  • Loading branch information
forslund committed Oct 22, 2020
1 parent 8a1b989 commit 0a9de0a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mycroft/client/speech/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from threading import Thread
import speech_recognition as sr
import pyaudio
from pyee import BaseEventEmitter
from pyee import EventEmitter
from requests import RequestException
from requests.exceptions import ConnectionError

Expand Down Expand Up @@ -271,7 +271,7 @@ def recognizer_conf_hash(config):
return hash(json.dumps(c, sort_keys=True))


class RecognizerLoop(BaseEventEmitter):
class RecognizerLoop(EventEmitter):
""" EventEmitter loop running speech recognition.
Local wake word recognizer and remote general speech recognition.
Expand Down
4 changes: 2 additions & 2 deletions mycroft/messagebus/service/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import traceback

from tornado.websocket import WebSocketHandler
from pyee import BaseEventEmitter
from pyee import EventEmitter

from mycroft.messagebus.message import Message
from mycroft.util.log import LOG
Expand All @@ -29,7 +29,7 @@
class MessageBusEventHandler(WebSocketHandler):
def __init__(self, application, request, **kwargs):
super().__init__(application, request, **kwargs)
self.emitter = BaseEventEmitter()
self.emitter = EventEmitter()

def on(self, event_name, handler):
self.emitter.on(event_name, handler)
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ six==1.13.0
requests==2.20.0
gTTS==2.1.1
PyAudio==0.2.11
pyee==7.0.1
pyee==8.1.0
SpeechRecognition==3.8.1
tornado==6.0.3
websocket-client==0.54.0
Expand Down
4 changes: 2 additions & 2 deletions test/integrationtests/skills/skill_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import re
import ast
from os.path import join, isdir, basename
from pyee import BaseEventEmitter
from pyee import EventEmitter
from numbers import Number
from mycroft.messagebus.message import Message
from mycroft.skills.core import MycroftSkill, FallbackSkill
Expand Down Expand Up @@ -167,7 +167,7 @@ class InterceptEmitter(object):
"""

def __init__(self):
self.emitter = BaseEventEmitter()
self.emitter = EventEmitter()
self.q = None

def on(self, event, f):
Expand Down
2 changes: 1 addition & 1 deletion test/wake_word/wake_word_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, samp_rate):

def test_audio(self, file_name):
source = FileMockMicrophone(file_name)
ee = pyee.BaseEventEmitter()
ee = pyee.EventEmitter()

class SharedData:
times_found = 0
Expand Down

0 comments on commit 0a9de0a

Please sign in to comment.