Merge pull request #636 from jodal/feature/move-backends

Move backends out of mopidy.backends
This commit is contained in:
Thomas Adamcik 2014-01-11 09:02:51 -08:00
commit ff4c965aff
31 changed files with 40 additions and 48 deletions

View File

@ -52,6 +52,5 @@ Backend listener
Backend implementations
=======================
* :mod:`mopidy.backends.dummy`
* :mod:`mopidy.backends.local`
* :mod:`mopidy.backends.stream`
* :mod:`mopidy.local`
* :mod:`mopidy.stream`

View File

@ -708,9 +708,9 @@ throughout Mopidy.
**Stream backend**
We've added a new backend for playing audio streams, the :mod:`stream backend
<mopidy.backends.stream>`. It is activated by default. The stream backend
supports the intersection of what your GStreamer installation supports and what
protocols are included in the :attr:`mopidy.settings.STREAM_PROTOCOLS` setting.
<mopidy.stream>`. It is activated by default. The stream backend supports the
intersection of what your GStreamer installation supports and what protocols
are included in the :attr:`mopidy.settings.STREAM_PROTOCOLS` setting.
Current limitations:

View File

@ -18,7 +18,7 @@ None. The extension just needs Mopidy.
Default configuration
=====================
.. literalinclude:: ../../mopidy/backends/local/ext.conf
.. literalinclude:: ../../mopidy/local/ext.conf
:language: ini
@ -105,7 +105,7 @@ whatever the current active library is with data. Only one library may be
active at a time.
To create a new library provider you must create class that implements the
:class:`~mopidy.backends.local.Libary` interface and install it in the
extension registry under ``local:library``. Any data that the library needs
to store on disc should be stored in :confval:`local/data_dir` using the
library name as part of the filename or directory to avoid any conflicts.
:class:`~mopidy.local.Library` interface and install it in the extension
registry under ``local:library``. Any data that the library needs to store on
disc should be stored in :confval:`local/data_dir` using the library name as
part of the filename or directory to avoid any conflicts.

View File

@ -20,7 +20,7 @@ None. The extension just needs Mopidy.
Default configuration
=====================
.. literalinclude:: ../../mopidy/backends/stream/ext.conf
.. literalinclude:: ../../mopidy/stream/ext.conf
:language: ini

View File

@ -7,9 +7,8 @@ import os
import tempfile
import mopidy
from mopidy import models
from mopidy.backends import local
from mopidy.backends.local import search
from mopidy import local, models
from mopidy.local import search
logger = logging.getLogger(__name__)

View File

@ -42,9 +42,9 @@ setup(
],
'mopidy.ext': [
'http = mopidy.http:Extension [http]',
'local = mopidy.backends.local:Extension',
'local = mopidy.local:Extension',
'mpd = mopidy.mpd:Extension',
'stream = mopidy.backends.stream:Extension',
'stream = mopidy.stream:Extension',
],
},
classifiers=[

View File

@ -6,14 +6,15 @@ import unittest
import pykka
from mopidy import core
from mopidy.backends import dummy
from mopidy.models import Track
from tests import dummy_backend
@mock.patch.object(core.CoreListener, 'send')
class BackendEventsTest(unittest.TestCase):
def setUp(self):
self.backend = dummy.create_dummy_backend_proxy()
self.backend = dummy_backend.create_dummy_backend_proxy()
self.core = core.Core.start(backends=[self.backend]).proxy()
def tearDown(self):

View File

@ -2,16 +2,6 @@
This backend implements the backend API in the simplest way possible. It is
used in tests of the frontends.
The backend handles URIs starting with ``dummy:``.
**Dependencies**
None
**Default config**
None
"""
from __future__ import unicode_literals

View File

@ -5,9 +5,9 @@ import unittest
import mock
import pykka
from mopidy import core, audio
from mopidy import audio, core
from mopidy.backends import listener
from mopidy.backends.local import actor
from mopidy.local import actor
from tests import path_to_data_dir

View File

@ -8,7 +8,7 @@ import unittest
import pykka
from mopidy import core
from mopidy.backends.local import actor, json
from mopidy.local import actor, json
from mopidy.models import Track, Album, Artist
from tests import path_to_data_dir

View File

@ -7,12 +7,12 @@ import unittest
import pykka
from mopidy import audio, core
from mopidy.backends.local import actor
from mopidy.core import PlaybackState
from mopidy.local import actor
from mopidy.models import Track
from tests import path_to_data_dir
from tests.backends.local import generate_song, populate_tracklist
from tests.local import generate_song, populate_tracklist
# TODO Test 'playlist repeat', e.g. repeat=1,single=0

View File

@ -8,11 +8,11 @@ import unittest
import pykka
from mopidy import audio, core
from mopidy.backends.local import actor
from mopidy.local import actor
from mopidy.models import Playlist, Track
from tests import path_to_data_dir
from tests.backends.local import generate_song
from tests.local import generate_song
class LocalPlaylistsProviderTest(unittest.TestCase):

View File

@ -6,12 +6,12 @@ import unittest
import pykka
from mopidy import audio, core
from mopidy.backends.local import actor
from mopidy.core import PlaybackState
from mopidy.local import actor
from mopidy.models import Playlist, TlTrack, Track
from tests import path_to_data_dir
from tests.backends.local import generate_song, populate_tracklist
from tests.local import generate_song, populate_tracklist
class LocalTracklistProviderTest(unittest.TestCase):

View File

@ -6,7 +6,7 @@ import os
import tempfile
import unittest
from mopidy.backends.local.translator import parse_m3u
from mopidy.local.translator import parse_m3u
from mopidy.models import Track
from mopidy.utils.path import path_to_uri

View File

@ -5,11 +5,12 @@ import unittest
import pykka
from mopidy import core
from mopidy.backends import dummy
from mopidy.mpd.dispatcher import MpdDispatcher
from mopidy.mpd.exceptions import MpdAckError
from mopidy.mpd.protocol import request_handlers, handle_request
from tests import dummy_backend
class MpdDispatcherTest(unittest.TestCase):
def setUp(self):
@ -18,7 +19,7 @@ class MpdDispatcherTest(unittest.TestCase):
'password': None,
}
}
self.backend = dummy.create_dummy_backend_proxy()
self.backend = dummy_backend.create_dummy_backend_proxy()
self.core = core.Core.start(backends=[self.backend]).proxy()
self.dispatcher = MpdDispatcher(config=config)

View File

@ -6,9 +6,10 @@ import unittest
import pykka
from mopidy import core
from mopidy.backends import dummy
from mopidy.mpd import session
from tests import dummy_backend
class MockConnection(mock.Mock):
def __init__(self, *args, **kwargs):
@ -31,7 +32,7 @@ class BaseTestCase(unittest.TestCase):
}
def setUp(self):
self.backend = dummy.create_dummy_backend_proxy()
self.backend = dummy_backend.create_dummy_backend_proxy()
self.core = core.Core.start(backends=[self.backend]).proxy()
self.connection = MockConnection()

View File

@ -5,12 +5,12 @@ import unittest
import pykka
from mopidy import core
from mopidy.backends import dummy
from mopidy.core import PlaybackState
from mopidy.models import Track
from mopidy.mpd import dispatcher
from mopidy.mpd.protocol import status
from mopidy.models import Track
from tests import dummy_backend
PAUSED = PlaybackState.PAUSED
PLAYING = PlaybackState.PLAYING
@ -22,7 +22,7 @@ STOPPED = PlaybackState.STOPPED
class StatusHandlerTest(unittest.TestCase):
def setUp(self):
self.backend = dummy.create_dummy_backend_proxy()
self.backend = dummy_backend.create_dummy_backend_proxy()
self.core = core.Core.start(backends=[self.backend]).proxy()
self.dispatcher = dispatcher.MpdDispatcher(core=self.core)
self.context = self.dispatcher.context

View File

@ -7,9 +7,10 @@ import unittest
import pykka
from mopidy import core, models
from mopidy.backends import dummy
from mopidy.utils import jsonrpc
from tests import dummy_backend
class Calculator(object):
def model(self):
@ -40,7 +41,7 @@ class Calculator(object):
class JsonRpcTestBase(unittest.TestCase):
def setUp(self):
self.backend = dummy.create_dummy_backend_proxy()
self.backend = dummy_backend.create_dummy_backend_proxy()
self.core = core.Core.start(backends=[self.backend]).proxy()
self.jrw = jsonrpc.JsonRpcWrapper(