diff --git a/mopidy/backends/local/__init__.py b/mopidy/backends/local/__init__.py index 58cb405d..2fa96dab 100644 --- a/mopidy/backends/local/__init__.py +++ b/mopidy/backends/local/__init__.py @@ -52,7 +52,7 @@ class LocalBackend(ThreadingActor, Backend): self.output = None - def pre_start(self): + def on_start(self): output_refs = ActorRegistry.get_by_class(BaseOutput) assert len(output_refs) == 1, 'Expected exactly one running output.' self.output = output_refs[0].proxy() diff --git a/mopidy/backends/spotify/__init__.py b/mopidy/backends/spotify/__init__.py index 9f2cd99f..1ac5f0be 100644 --- a/mopidy/backends/spotify/__init__.py +++ b/mopidy/backends/spotify/__init__.py @@ -66,7 +66,7 @@ class SpotifyBackend(ThreadingActor, Backend): self.output = None self.spotify = None - def pre_start(self): + def on_start(self): output_refs = ActorRegistry.get_by_class(BaseOutput) assert len(output_refs) == 1, 'Expected exactly one running output.' self.output = output_refs[0].proxy() diff --git a/mopidy/frontends/lastfm.py b/mopidy/frontends/lastfm.py index 8d6cf2a8..04716c61 100644 --- a/mopidy/frontends/lastfm.py +++ b/mopidy/frontends/lastfm.py @@ -40,7 +40,7 @@ class LastfmFrontend(ThreadingActor, BaseFrontend): self.lastfm = None self.last_start_time = None - def pre_start(self): + def on_start(self): try: username = settings.LASTFM_USERNAME password_hash = pylast.md5(settings.LASTFM_PASSWORD) @@ -57,7 +57,7 @@ class LastfmFrontend(ThreadingActor, BaseFrontend): logger.error(u'Error during Last.fm setup: %s', e) self.stop() - def react(self, message): + def on_receive(self, message): if message.get('command') == 'started_playing': self.started_playing(message['track']) elif message.get('command') == 'stopped_playing': diff --git a/mopidy/frontends/mpd/__init__.py b/mopidy/frontends/mpd/__init__.py index 6c39a09b..24c21c38 100644 --- a/mopidy/frontends/mpd/__init__.py +++ b/mopidy/frontends/mpd/__init__.py @@ -23,11 +23,11 @@ class MpdFrontend(ThreadingActor, BaseFrontend): def __init__(self): self._thread = None - def pre_start(self): + def on_start(self): self._thread = MpdThread() self._thread.start() - def react(self, message): + def on_receive(self, message): pass # Ignore any messages diff --git a/mopidy/mixers/alsa.py b/mopidy/mixers/alsa.py index a7f5431e..6329bbbb 100644 --- a/mopidy/mixers/alsa.py +++ b/mopidy/mixers/alsa.py @@ -25,7 +25,7 @@ class AlsaMixer(ThreadingActor, BaseMixer): def __init__(self): self._mixer = None - def pre_start(self): + def on_start(self): self._mixer = alsaaudio.Mixer(self._get_mixer_control()) assert self._mixer is not None diff --git a/mopidy/mixers/denon.py b/mopidy/mixers/denon.py index 966f804a..3922d20a 100644 --- a/mopidy/mixers/denon.py +++ b/mopidy/mixers/denon.py @@ -30,7 +30,7 @@ class DenonMixer(ThreadingActor, BaseMixer): self._levels = ['99'] + ["%(#)02d" % {'#': v} for v in range(0, 99)] self._volume = 0 - def pre_start(self): + def on_start(self): if self._device is None: from serial import Serial self._device = Serial(port=settings.MIXER_EXT_PORT, timeout=0.2) diff --git a/mopidy/mixers/gstreamer_software.py b/mopidy/mixers/gstreamer_software.py index b93e1b52..d6365b4b 100644 --- a/mopidy/mixers/gstreamer_software.py +++ b/mopidy/mixers/gstreamer_software.py @@ -10,7 +10,7 @@ class GStreamerSoftwareMixer(ThreadingActor, BaseMixer): def __init__(self): self.output = None - def pre_start(self): + def on_start(self): output_refs = ActorRegistry.get_by_class(BaseOutput) assert len(output_refs) == 1, 'Expected exactly one running output.' self.output = output_refs[0].proxy() diff --git a/mopidy/mixers/nad.py b/mopidy/mixers/nad.py index db4b40c1..bd53376e 100644 --- a/mopidy/mixers/nad.py +++ b/mopidy/mixers/nad.py @@ -73,7 +73,7 @@ class NadTalker(ThreadingActor): def __init__(self): self._device = None - def pre_start(self): + def on_start(self): self._open_connection() self._set_device_to_known_state() diff --git a/mopidy/outputs/gstreamer.py b/mopidy/outputs/gstreamer.py index 37bfb35c..0596addb 100644 --- a/mopidy/outputs/gstreamer.py +++ b/mopidy/outputs/gstreamer.py @@ -26,7 +26,7 @@ class GStreamerOutput(ThreadingActor, BaseOutput): def __init__(self): self.gst_pipeline = None - def pre_start(self): + def on_start(self): self._setup_gstreamer() def _setup_gstreamer(self): diff --git a/tests/outputs/gstreamer_test.py b/tests/outputs/gstreamer_test.py index 4e101319..d2e3c263 100644 --- a/tests/outputs/gstreamer_test.py +++ b/tests/outputs/gstreamer_test.py @@ -19,7 +19,7 @@ class GStreamerOutputTest(unittest.TestCase): settings.BACKENDS = ('mopidy.backends.local.LocalBackend',) self.song_uri = path_to_uri(data_folder('song1.wav')) self.output = GStreamerOutput() - self.output.pre_start() + self.output.on_start() def tearDown(self): settings.runtime.clear()