diff --git a/docs/api/mpd.rst b/docs/api/mpd.rst index 021f5dcd..35c897b2 100644 --- a/docs/api/mpd.rst +++ b/docs/api/mpd.rst @@ -1,11 +1,11 @@ -***************** -:mod:`mopidy.mpd` -***************** +*************************** +:mod:`mopidy.frontends.mpd` +*************************** MPD protocol implementation =========================== -.. automodule:: mopidy.mpd.frontend +.. automodule:: mopidy.frontends.mpd.frontend :synopsis: Our MPD protocol implementation. :members: :undoc-members: @@ -14,9 +14,9 @@ MPD protocol implementation MPD server implementation ========================= -.. automodule:: mopidy.mpd.server +.. automodule:: mopidy.frontends.mpd.server :synopsis: Our MPD server implementation. :members: :undoc-members: -.. inheritance-diagram:: mopidy.mpd.server +.. inheritance-diagram:: mopidy.frontends.mpd.server diff --git a/docs/changes.rst b/docs/changes.rst index 5fa08444..42454f4a 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -17,6 +17,7 @@ Another great release. the packages created by ``setup.py`` for i.e. PyPI. - MPD frontend: + - Relocate from :mod:`mopidy.mpd` to :mod:`mopidy.frontends.mpd`. - Search improvements, including support for multi-word search. - Fixed ``play "-1"`` and ``playid "-1"`` behaviour when playlist is empty. diff --git a/mopidy/backends/__init__.py b/mopidy/backends/__init__.py index e9f6b4c5..5bb8142a 100644 --- a/mopidy/backends/__init__.py +++ b/mopidy/backends/__init__.py @@ -4,8 +4,8 @@ import random import time from mopidy import settings +from mopidy.frontends.mpd import serializer from mopidy.models import Playlist -from mopidy.mpd import serializer from mopidy.utils import get_class logger = logging.getLogger('mopidy.backends.base') diff --git a/tests/mpd/__init__.py b/mopidy/frontends/__init__.py similarity index 100% rename from tests/mpd/__init__.py rename to mopidy/frontends/__init__.py diff --git a/mopidy/mpd/__init__.py b/mopidy/frontends/mpd/__init__.py similarity index 100% rename from mopidy/mpd/__init__.py rename to mopidy/frontends/mpd/__init__.py diff --git a/mopidy/mpd/frontend.py b/mopidy/frontends/mpd/frontend.py similarity index 99% rename from mopidy/mpd/frontend.py rename to mopidy/frontends/mpd/frontend.py index d4ed6a73..08e6237e 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/frontends/mpd/frontend.py @@ -14,11 +14,11 @@ import datetime as dt import logging import re -from mopidy.mpd import (MpdAckError, MpdArgError, MpdUnknownCommand, +from mopidy.frontends.mpd import (MpdAckError, MpdArgError, MpdUnknownCommand, MpdNoExistError, MpdNotImplemented) from mopidy.utils import flatten -logger = logging.getLogger('mopidy.mpd.frontend') +logger = logging.getLogger('mopidy.frontends.mpd.frontend') _commands = set() _request_handlers = {} diff --git a/mopidy/mpd/serializer.py b/mopidy/frontends/mpd/serializer.py similarity index 100% rename from mopidy/mpd/serializer.py rename to mopidy/frontends/mpd/serializer.py diff --git a/mopidy/mpd/server.py b/mopidy/frontends/mpd/server.py similarity index 98% rename from mopidy/mpd/server.py rename to mopidy/frontends/mpd/server.py index 4dc8058e..1458b90e 100644 --- a/mopidy/mpd/server.py +++ b/mopidy/frontends/mpd/server.py @@ -13,7 +13,7 @@ import sys from mopidy import get_mpd_protocol_version, settings from mopidy.utils import indent, pickle_connection -logger = logging.getLogger('mopidy.mpd.server') +logger = logging.getLogger('mopidy.frontends.mpd.server') #: The MPD protocol uses UTF-8 for encoding all data. ENCODING = u'utf-8' diff --git a/mopidy/models.py b/mopidy/models.py index 5a75e620..e4281360 100644 --- a/mopidy/models.py +++ b/mopidy/models.py @@ -1,6 +1,6 @@ from copy import copy -from mopidy.mpd import serializer +from mopidy.frontends.mpd import serializer class ImmutableObject(object): """ diff --git a/mopidy/settings.py b/mopidy/settings.py index dc2eda57..1192c28d 100644 --- a/mopidy/settings.py +++ b/mopidy/settings.py @@ -41,8 +41,8 @@ DUMP_LOG_FILENAME = u'dump.log' #: Protocol frontend to use. Default:: #: -#: FRONTEND = u'mopidy.mpd.frontend.MpdFrontend' -FRONTEND = u'mopidy.mpd.frontend.MpdFrontend' +#: FRONTEND = u'mopidy.frontends.mpd.frontend.MpdFrontend' +FRONTEND = u'mopidy.frontends.mpd.frontend.MpdFrontend' #: Path to folder with local music. Default:: #: @@ -107,8 +107,8 @@ MIXER_EXT_SPEAKERS_B = None #: Server to use. Default:: #: -#: SERVER = u'mopidy.mpd.server.MpdServer' -SERVER = u'mopidy.mpd.server.MpdServer' +#: SERVER = u'mopidy.frontends.mpd.server.MpdServer' +SERVER = u'mopidy.frontends.mpd.server.MpdServer' #: Which address Mopidy should bind to. Examples: #: diff --git a/tests/frontends/__init__.py b/tests/frontends/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/frontends/mpd/__init__.py b/tests/frontends/mpd/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/mpd/audio_output_test.py b/tests/frontends/mpd/audio_output_test.py similarity index 95% rename from tests/mpd/audio_output_test.py rename to tests/frontends/mpd/audio_output_test.py index 6e6ea5b5..c752f40e 100644 --- a/tests/mpd/audio_output_test.py +++ b/tests/frontends/mpd/audio_output_test.py @@ -1,8 +1,8 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer -from mopidy.mpd import frontend class AudioOutputHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/command_list_test.py b/tests/frontends/mpd/command_list_test.py similarity index 98% rename from tests/mpd/command_list_test.py rename to tests/frontends/mpd/command_list_test.py index 69eb19ac..eed92a24 100644 --- a/tests/mpd/command_list_test.py +++ b/tests/frontends/mpd/command_list_test.py @@ -1,8 +1,8 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer -from mopidy.mpd import frontend class CommandListsTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/connection_test.py b/tests/frontends/mpd/connection_test.py similarity index 95% rename from tests/mpd/connection_test.py rename to tests/frontends/mpd/connection_test.py index 82c7d5c8..83133050 100644 --- a/tests/mpd/connection_test.py +++ b/tests/frontends/mpd/connection_test.py @@ -1,8 +1,8 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer -from mopidy.mpd import frontend class ConnectionHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/current_playlist_test.py b/tests/frontends/mpd/current_playlist_test.py similarity index 99% rename from tests/mpd/current_playlist_test.py rename to tests/frontends/mpd/current_playlist_test.py index 245cabbb..ce1e4069 100644 --- a/tests/mpd/current_playlist_test.py +++ b/tests/frontends/mpd/current_playlist_test.py @@ -1,9 +1,9 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer from mopidy.models import Track -from mopidy.mpd import frontend class CurrentPlaylistHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/exception_test.py b/tests/frontends/mpd/exception_test.py similarity index 93% rename from tests/mpd/exception_test.py rename to tests/frontends/mpd/exception_test.py index 139d56ee..e337550f 100644 --- a/tests/mpd/exception_test.py +++ b/tests/frontends/mpd/exception_test.py @@ -1,6 +1,7 @@ import unittest -from mopidy.mpd import MpdAckError, MpdUnknownCommand, MpdNotImplemented +from mopidy.frontends.mpd import (MpdAckError, MpdUnknownCommand, + MpdNotImplemented) class MpdExceptionsTest(unittest.TestCase): def test_key_error_wrapped_in_mpd_ack_error(self): diff --git a/tests/mpd/music_db_test.py b/tests/frontends/mpd/music_db_test.py similarity index 99% rename from tests/mpd/music_db_test.py rename to tests/frontends/mpd/music_db_test.py index b8feb65f..62915a58 100644 --- a/tests/mpd/music_db_test.py +++ b/tests/frontends/mpd/music_db_test.py @@ -1,8 +1,8 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer -from mopidy.mpd import frontend class MusicDatabaseHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/playback_test.py b/tests/frontends/mpd/playback_test.py similarity index 99% rename from tests/mpd/playback_test.py rename to tests/frontends/mpd/playback_test.py index ed7cdf33..aee05d6c 100644 --- a/tests/mpd/playback_test.py +++ b/tests/frontends/mpd/playback_test.py @@ -1,9 +1,9 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer from mopidy.models import Track -from mopidy.mpd import frontend class PlaybackOptionsHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/reflection_test.py b/tests/frontends/mpd/reflection_test.py similarity index 97% rename from tests/mpd/reflection_test.py rename to tests/frontends/mpd/reflection_test.py index 70af604f..11bd5ba9 100644 --- a/tests/mpd/reflection_test.py +++ b/tests/frontends/mpd/reflection_test.py @@ -1,8 +1,8 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer -from mopidy.mpd import frontend class ReflectionHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/request_handler_test.py b/tests/frontends/mpd/request_handler_test.py similarity index 97% rename from tests/mpd/request_handler_test.py rename to tests/frontends/mpd/request_handler_test.py index 1dcba9ad..ca4cdd3e 100644 --- a/tests/mpd/request_handler_test.py +++ b/tests/frontends/mpd/request_handler_test.py @@ -1,8 +1,8 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend, MpdAckError from mopidy.mixers.dummy import DummyMixer -from mopidy.mpd import frontend, MpdAckError class RequestHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/serializer_test.py b/tests/frontends/mpd/serializer_test.py similarity index 98% rename from tests/mpd/serializer_test.py rename to tests/frontends/mpd/serializer_test.py index 38c240c2..e2fda8fa 100644 --- a/tests/mpd/serializer_test.py +++ b/tests/frontends/mpd/serializer_test.py @@ -1,8 +1,8 @@ import datetime as dt import unittest +from mopidy.frontends.mpd import serializer from mopidy.models import Album, Artist, Playlist, Track -from mopidy.mpd import serializer class TrackMpdFormatTest(unittest.TestCase): def test_mpd_format_for_empty_track(self): diff --git a/tests/mpd/server_test.py b/tests/frontends/mpd/server_test.py similarity index 96% rename from tests/mpd/server_test.py rename to tests/frontends/mpd/server_test.py index e1612c1d..9d006eb3 100644 --- a/tests/mpd/server_test.py +++ b/tests/frontends/mpd/server_test.py @@ -1,6 +1,6 @@ import unittest -from mopidy.mpd import server +from mopidy.frontends.mpd import server class MpdServerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/status_test.py b/tests/frontends/mpd/status_test.py similarity index 99% rename from tests/mpd/status_test.py rename to tests/frontends/mpd/status_test.py index ae1ac816..7d839b67 100644 --- a/tests/mpd/status_test.py +++ b/tests/frontends/mpd/status_test.py @@ -1,9 +1,9 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer from mopidy.models import Track -from mopidy.mpd import frontend class StatusHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/stickers_test.py b/tests/frontends/mpd/stickers_test.py similarity index 97% rename from tests/mpd/stickers_test.py rename to tests/frontends/mpd/stickers_test.py index 437251a4..83bbdd04 100644 --- a/tests/mpd/stickers_test.py +++ b/tests/frontends/mpd/stickers_test.py @@ -1,8 +1,8 @@ import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer -from mopidy.mpd import frontend class StickersHandlerTest(unittest.TestCase): def setUp(self): diff --git a/tests/mpd/stored_playlists_test.py b/tests/frontends/mpd/stored_playlists_test.py similarity index 98% rename from tests/mpd/stored_playlists_test.py rename to tests/frontends/mpd/stored_playlists_test.py index b616695e..179e0802 100644 --- a/tests/mpd/stored_playlists_test.py +++ b/tests/frontends/mpd/stored_playlists_test.py @@ -2,9 +2,9 @@ import datetime as dt import unittest from mopidy.backends.dummy import DummyBackend +from mopidy.frontends.mpd import frontend from mopidy.mixers.dummy import DummyMixer from mopidy.models import Track, Playlist -from mopidy.mpd import frontend from tests import SkipTest