Update DummyBackend to adhere to new backend API

This commit is contained in:
Stein Magnus Jodal 2010-02-08 00:11:36 +01:00
parent e981edc2cc
commit 98e333bafa

View File

@ -1,25 +1,30 @@
from mopidy.backends import BaseBackend
from mopidy.backends import (BaseBackend, BaseCurrentPlaylistController,
BasePlaybackController, BaseLibraryController,
BaseStoredPlaylistsController)
class DummyBackend(BaseBackend):
def __init__(self, *args, **kwargs):
super(DummyBackend, self).__init__(*args, **kwargs)
def __init__(self):
self.current_playlist = DummyCurrentPlaylistController(backend=self)
self.library = DummyLibraryController(backend=self)
self.playback = DummyPlaybackController(backend=self)
self.stored_playlists = DummyStoredPlaylistsController(backend=self)
self.uri_handlers = [u'dummy:']
def url_handlers(self):
return [u'dummy:']
class DummyCurrentPlaylistController(BaseCurrentPlaylistController):
pass
class DummyLibraryController(BaseLibraryController):
def search(self, type, query):
return []
class DummyPlaybackController(BasePlaybackController):
def _next(self):
return True
def _pause(self):
return True
def _play(self):
return True
def _play_id(self, songid):
return True
def _play_pos(self, songpos):
def _play(self, track):
return True
def _previous(self):
@ -27,3 +32,6 @@ class DummyBackend(BaseBackend):
def _resume(self):
return True
class DummyStoredPlaylistsController(BaseStoredPlaylistsController):
pass