Update to work with Pykka 1.0

This commit is contained in:
Stein Magnus Jodal 2012-10-26 22:32:06 +02:00
parent b53a82dbba
commit f1e2cff3e0
8 changed files with 12 additions and 8 deletions

View File

@ -8,6 +8,10 @@ This change log is used to track all major changes to Mopidy.
v0.8.1 (in development) v0.8.1 (in development)
======================= =======================
**Dependencies**
- Pykka >= 1.0 is now required.
**Bug fixes** **Bug fixes**
- :issue:`213`: Fix "streaming task paused, reason not-negotiated" errors - :issue:`213`: Fix "streaming task paused, reason not-negotiated" errors

View File

@ -26,7 +26,7 @@ dependencies installed.
- Python >= 2.6, < 3 - Python >= 2.6, < 3
- Pykka >= 0.12.3:: - Pykka >= 1.0::
sudo pip install -U pykka sudo pip install -U pykka

View File

@ -14,7 +14,7 @@ class DummyBackend(ThreadingActor, base.Backend):
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(DummyBackend, self).__init__(*args, **kwargs) super(DummyBackend, self).__init__()
self.current_playlist = core.CurrentPlaylistController(backend=self) self.current_playlist = core.CurrentPlaylistController(backend=self)

View File

@ -32,7 +32,7 @@ class LocalBackend(ThreadingActor, base.Backend):
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(LocalBackend, self).__init__(*args, **kwargs) super(LocalBackend, self).__init__()
self.current_playlist = core.CurrentPlaylistController(backend=self) self.current_playlist = core.CurrentPlaylistController(backend=self)

View File

@ -47,7 +47,7 @@ class SpotifyBackend(ThreadingActor, base.Backend):
from .playback import SpotifyPlaybackProvider from .playback import SpotifyPlaybackProvider
from .stored_playlists import SpotifyStoredPlaylistsProvider from .stored_playlists import SpotifyStoredPlaylistsProvider
super(SpotifyBackend, self).__init__(*args, **kwargs) super(SpotifyBackend, self).__init__()
self.current_playlist = core.CurrentPlaylistController(backend=self) self.current_playlist = core.CurrentPlaylistController(backend=self)

View File

@ -250,7 +250,7 @@ class Connection(object):
return True return True
try: try:
self.actor_ref.send_one_way({'received': data}) self.actor_ref.tell({'received': data})
except ActorDeadError: except ActorDeadError:
self.stop(u'Actor is dead.') self.stop(u'Actor is dead.')

View File

@ -1 +1 @@
Pykka >= 0.12.3 Pykka >= 1.0

View File

@ -383,14 +383,14 @@ class ConnectionTest(unittest.TestCase):
self.assertTrue(network.Connection.recv_callback( self.assertTrue(network.Connection.recv_callback(
self.mock, sentinel.fd, gobject.IO_IN)) self.mock, sentinel.fd, gobject.IO_IN))
self.mock.actor_ref.send_one_way.assert_called_once_with( self.mock.actor_ref.tell.assert_called_once_with(
{'received': 'data'}) {'received': 'data'})
def test_recv_callback_handles_dead_actors(self): def test_recv_callback_handles_dead_actors(self):
self.mock.sock = Mock(spec=socket.SocketType) self.mock.sock = Mock(spec=socket.SocketType)
self.mock.sock.recv.return_value = 'data' self.mock.sock.recv.return_value = 'data'
self.mock.actor_ref = Mock() self.mock.actor_ref = Mock()
self.mock.actor_ref.send_one_way.side_effect = pykka.ActorDeadError() self.mock.actor_ref.tell.side_effect = pykka.ActorDeadError()
self.assertTrue(network.Connection.recv_callback( self.assertTrue(network.Connection.recv_callback(
self.mock, sentinel.fd, gobject.IO_IN)) self.mock, sentinel.fd, gobject.IO_IN))