diff --git a/MANIFEST.in b/MANIFEST.in index cacaa924..b3a70f17 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,6 +7,6 @@ recursive-include docs * prune docs/_build recursive-include mopidy *.conf -recursive-include mopidy/frontends/http/data * +recursive-include mopidy/http/data * recursive-include tests *.py recursive-include tests/data * diff --git a/README.rst b/README.rst index 0b003815..c2026d14 100644 --- a/README.rst +++ b/README.rst @@ -40,3 +40,7 @@ To get started with Mopidy, check out `the docs `_. .. image:: https://coveralls.io/repos/mopidy/mopidy/badge.png?branch=develop :target: https://coveralls.io/r/mopidy/mopidy?branch=develop :alt: Test coverage + +.. image:: https://sourcegraph.com/api/repos/github.com/mopidy/mopidy/counters/views-24h.png + :target: https://sourcegraph.com/github.com/mopidy/mopidy + :alt: Mopidy stats diff --git a/docs/api/core.rst b/docs/api/core.rst index 0fd3e0c8..38cc0f0a 100644 --- a/docs/api/core.rst +++ b/docs/api/core.rst @@ -8,8 +8,8 @@ Core API :synopsis: Core API for use by frontends The core API is the interface that is used by frontends like -:mod:`mopidy.frontends.mpd`. The core layer is inbetween the frontends and the -backends. +:mod:`mopidy.http` and :mod:`mopidy.mpd`. The core layer is inbetween the +frontends and the backends. .. autoclass:: mopidy.core.Core :members: diff --git a/docs/api/frontends.rst b/docs/api/frontends.rst index 70bd73cf..7afafa74 100644 --- a/docs/api/frontends.rst +++ b/docs/api/frontends.rst @@ -47,5 +47,5 @@ The following requirements applies to any frontend implementation: Frontend implementations ======================== -* :mod:`mopidy.frontends.http` -* :mod:`mopidy.frontends.mpd` +* :mod:`mopidy.http` +* :mod:`mopidy.mpd` diff --git a/docs/api/http.rst b/docs/api/http.rst index 16546683..c57597c7 100644 --- a/docs/api/http.rst +++ b/docs/api/http.rst @@ -113,8 +113,8 @@ HTML file: If you don't use Mopidy to host your web client, you can find the JS files in the Git repo at: -- ``mopidy/frontends/http/data/mopidy.js`` -- ``mopidy/frontends/http/data/mopidy.min.js`` +- ``mopidy/http/data/mopidy.js`` +- ``mopidy/http/data/mopidy.min.js`` Getting the library for Node.js use diff --git a/docs/changelog.rst b/docs/changelog.rst index 601de39e..56177441 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -12,6 +12,9 @@ v0.18.0 (UNRELEASED) - Expose :meth:`mopidy.core.Core.version` for HTTP clients to manage compatibility between API versions. (Fixes: :issue:`597`) +- Add :class:`mopidy.models.Ref` class for use as a lightweight reference to + other model types, containing just an URI, a name, and an object type. + **Pluggable local libraries** Fixes issues :issue:`44`, partially resolves :issue:`397`, and causes diff --git a/docs/ext/http.rst b/docs/ext/http.rst index d011a4b9..83881292 100644 --- a/docs/ext/http.rst +++ b/docs/ext/http.rst @@ -9,12 +9,6 @@ from a web based client. See :ref:`http-api` for details on how to integrate with Mopidy over HTTP. -Known issues -============ - -https://github.com/mopidy/mopidy/issues?labels=HTTP+frontend - - Dependencies ============ @@ -32,7 +26,7 @@ install Mopidy with the extra dependencies for required for Mopidy-HTTP:: Default configuration ===================== -.. literalinclude:: ../../mopidy/frontends/http/ext.conf +.. literalinclude:: ../../mopidy/http/ext.conf :language: ini diff --git a/docs/ext/mpd.rst b/docs/ext/mpd.rst index eb502221..46a01715 100644 --- a/docs/ext/mpd.rst +++ b/docs/ext/mpd.rst @@ -12,8 +12,7 @@ server project `_. Mopidy does not depend on the original MPD server, but implements the MPD protocol itself, and is thus compatible with clients for the original MPD server. -For more details on our MPD server implementation, see -:mod:`mopidy.frontends.mpd`. +For more details on our MPD server implementation, see :mod:`mopidy.mpd`. Known issues @@ -54,7 +53,7 @@ None. The extension just needs Mopidy. Default configuration ===================== -.. literalinclude:: ../../mopidy/frontends/mpd/ext.conf +.. literalinclude:: ../../mopidy/mpd/ext.conf :language: ini diff --git a/docs/modules/frontends/mpd.rst b/docs/modules/mpd.rst similarity index 61% rename from docs/modules/frontends/mpd.rst rename to docs/modules/mpd.rst index 750d19bb..85cb2789 100644 --- a/docs/modules/frontends/mpd.rst +++ b/docs/modules/mpd.rst @@ -1,17 +1,17 @@ ***************************************** -:mod:`mopidy.frontends.mpd` -- MPD server +:mod:`mopidy.mpd` -- MPD server ***************************************** For details on how to use Mopidy's MPD server, see :ref:`ext-mpd`. -.. automodule:: mopidy.frontends.mpd +.. automodule:: mopidy.mpd :synopsis: MPD server frontend MPD dispatcher ============== -.. automodule:: mopidy.frontends.mpd.dispatcher +.. automodule:: mopidy.mpd.dispatcher :synopsis: MPD request dispatcher :members: @@ -19,7 +19,7 @@ MPD dispatcher MPD protocol ============ -.. automodule:: mopidy.frontends.mpd.protocol +.. automodule:: mopidy.mpd.protocol :synopsis: MPD protocol :members: @@ -27,7 +27,7 @@ MPD protocol Audio output ------------ -.. automodule:: mopidy.frontends.mpd.protocol.audio_output +.. automodule:: mopidy.mpd.protocol.audio_output :synopsis: MPD protocol: audio output :members: @@ -35,7 +35,7 @@ Audio output Channels -------- -.. automodule:: mopidy.frontends.mpd.protocol.channels +.. automodule:: mopidy.mpd.protocol.channels :synopsis: MPD protocol: channels -- client to client communication :members: @@ -43,7 +43,7 @@ Channels Command list ------------ -.. automodule:: mopidy.frontends.mpd.protocol.command_list +.. automodule:: mopidy.mpd.protocol.command_list :synopsis: MPD protocol: command list :members: @@ -51,7 +51,7 @@ Command list Connection ---------- -.. automodule:: mopidy.frontends.mpd.protocol.connection +.. automodule:: mopidy.mpd.protocol.connection :synopsis: MPD protocol: connection :members: @@ -59,7 +59,7 @@ Connection Current playlist ---------------- -.. automodule:: mopidy.frontends.mpd.protocol.current_playlist +.. automodule:: mopidy.mpd.protocol.current_playlist :synopsis: MPD protocol: current playlist :members: @@ -67,7 +67,7 @@ Current playlist Music database -------------- -.. automodule:: mopidy.frontends.mpd.protocol.music_db +.. automodule:: mopidy.mpd.protocol.music_db :synopsis: MPD protocol: music database :members: @@ -75,7 +75,7 @@ Music database Playback -------- -.. automodule:: mopidy.frontends.mpd.protocol.playback +.. automodule:: mopidy.mpd.protocol.playback :synopsis: MPD protocol: playback :members: @@ -83,7 +83,7 @@ Playback Reflection ---------- -.. automodule:: mopidy.frontends.mpd.protocol.reflection +.. automodule:: mopidy.mpd.protocol.reflection :synopsis: MPD protocol: reflection :members: @@ -91,7 +91,7 @@ Reflection Status ------ -.. automodule:: mopidy.frontends.mpd.protocol.status +.. automodule:: mopidy.mpd.protocol.status :synopsis: MPD protocol: status :members: @@ -99,7 +99,7 @@ Status Stickers -------- -.. automodule:: mopidy.frontends.mpd.protocol.stickers +.. automodule:: mopidy.mpd.protocol.stickers :synopsis: MPD protocol: stickers :members: @@ -107,6 +107,6 @@ Stickers Stored playlists ---------------- -.. automodule:: mopidy.frontends.mpd.protocol.stored_playlists +.. automodule:: mopidy.mpd.protocol.stored_playlists :synopsis: MPD protocol: stored playlists :members: diff --git a/js/Gruntfile.js b/js/Gruntfile.js index 43a4770b..c1e687c9 100644 --- a/js/Gruntfile.js +++ b/js/Gruntfile.js @@ -11,8 +11,8 @@ module.exports = function (grunt) { " * Licensed under the Apache License, Version 2.0 */\n", files: { own: ["Gruntfile.js", "src/**/*.js", "test/**/*-test.js"], - concat: "../mopidy/frontends/http/data/mopidy.js", - minified: "../mopidy/frontends/http/data/mopidy.min.js" + concat: "../mopidy/http/data/mopidy.js", + minified: "../mopidy/http/data/mopidy.min.js" } }, buster: { diff --git a/js/README.md b/js/README.md index eddfa99f..753e858a 100644 --- a/js/README.md +++ b/js/README.md @@ -21,8 +21,8 @@ You may need to adjust hostname and port for your local setup. In the source repo, you can find the files at: -- `mopidy/frontends/http/data/mopidy.js` -- `mopidy/frontends/http/data/mopidy.min.js` +- `mopidy/http/data/mopidy.js` +- `mopidy/http/data/mopidy.min.js` Getting it for Node.js use @@ -72,7 +72,7 @@ To run tests automatically when you save a file: npm start To run tests, concatenate, minify the source, and update the JavaScript files -in `mopidy/frontends/http/data/`: +in `mopidy/http/data/`: npm run-script build diff --git a/mopidy/frontends/http/__init__.py b/mopidy/http/__init__.py similarity index 100% rename from mopidy/frontends/http/__init__.py rename to mopidy/http/__init__.py diff --git a/mopidy/frontends/http/actor.py b/mopidy/http/actor.py similarity index 98% rename from mopidy/frontends/http/actor.py rename to mopidy/http/actor.py index 5aef3506..cc7c11a1 100644 --- a/mopidy/frontends/http/actor.py +++ b/mopidy/http/actor.py @@ -14,7 +14,7 @@ from mopidy.core import CoreListener from . import ws -logger = logging.getLogger('mopidy.frontends.http') +logger = logging.getLogger('mopidy.http') class HttpFrontend(pykka.ThreadingActor, CoreListener): diff --git a/mopidy/frontends/http/data/favicon.png b/mopidy/http/data/favicon.png similarity index 100% rename from mopidy/frontends/http/data/favicon.png rename to mopidy/http/data/favicon.png diff --git a/mopidy/frontends/http/data/index.html b/mopidy/http/data/index.html similarity index 100% rename from mopidy/frontends/http/data/index.html rename to mopidy/http/data/index.html diff --git a/mopidy/frontends/http/data/mopidy.css b/mopidy/http/data/mopidy.css similarity index 100% rename from mopidy/frontends/http/data/mopidy.css rename to mopidy/http/data/mopidy.css diff --git a/mopidy/frontends/http/data/mopidy.html b/mopidy/http/data/mopidy.html similarity index 100% rename from mopidy/frontends/http/data/mopidy.html rename to mopidy/http/data/mopidy.html diff --git a/mopidy/frontends/http/data/mopidy.js b/mopidy/http/data/mopidy.js similarity index 100% rename from mopidy/frontends/http/data/mopidy.js rename to mopidy/http/data/mopidy.js diff --git a/mopidy/frontends/http/data/mopidy.min.js b/mopidy/http/data/mopidy.min.js similarity index 100% rename from mopidy/frontends/http/data/mopidy.min.js rename to mopidy/http/data/mopidy.min.js diff --git a/mopidy/frontends/http/ext.conf b/mopidy/http/ext.conf similarity index 100% rename from mopidy/frontends/http/ext.conf rename to mopidy/http/ext.conf diff --git a/mopidy/frontends/http/ws.py b/mopidy/http/ws.py similarity index 97% rename from mopidy/frontends/http/ws.py rename to mopidy/http/ws.py index d773b422..5a0f2039 100644 --- a/mopidy/frontends/http/ws.py +++ b/mopidy/http/ws.py @@ -9,7 +9,7 @@ from mopidy import core, models from mopidy.utils import jsonrpc -logger = logging.getLogger('mopidy.frontends.http') +logger = logging.getLogger('mopidy.http') class WebSocketResource(object): diff --git a/mopidy/frontends/mpd/__init__.py b/mopidy/mpd/__init__.py similarity index 100% rename from mopidy/frontends/mpd/__init__.py rename to mopidy/mpd/__init__.py diff --git a/mopidy/frontends/mpd/actor.py b/mopidy/mpd/actor.py similarity index 96% rename from mopidy/frontends/mpd/actor.py rename to mopidy/mpd/actor.py index fb063f6c..9c33faaa 100644 --- a/mopidy/frontends/mpd/actor.py +++ b/mopidy/mpd/actor.py @@ -7,10 +7,10 @@ import pykka from mopidy import zeroconf from mopidy.core import CoreListener -from mopidy.frontends.mpd import session +from mopidy.mpd import session from mopidy.utils import encoding, network, process -logger = logging.getLogger('mopidy.frontends.mpd') +logger = logging.getLogger('mopidy.mpd') class MpdFrontend(pykka.ThreadingActor, CoreListener): diff --git a/mopidy/frontends/mpd/dispatcher.py b/mopidy/mpd/dispatcher.py similarity index 98% rename from mopidy/frontends/mpd/dispatcher.py rename to mopidy/mpd/dispatcher.py index ec3b71f8..c3881f6f 100644 --- a/mopidy/frontends/mpd/dispatcher.py +++ b/mopidy/mpd/dispatcher.py @@ -5,9 +5,9 @@ import re import pykka -from mopidy.frontends.mpd import exceptions, protocol +from mopidy.mpd import exceptions, protocol -logger = logging.getLogger('mopidy.frontends.mpd.dispatcher') +logger = logging.getLogger('mopidy.mpd.dispatcher') protocol.load_protocol_modules() @@ -221,7 +221,7 @@ class MpdContext(object): #: The current :class:`MpdDispatcher`. dispatcher = None - #: The current :class:`mopidy.frontends.mpd.MpdSession`. + #: The current :class:`mopidy.mpd.MpdSession`. session = None #: The Mopidy configuration. diff --git a/mopidy/frontends/mpd/exceptions.py b/mopidy/mpd/exceptions.py similarity index 100% rename from mopidy/frontends/mpd/exceptions.py rename to mopidy/mpd/exceptions.py diff --git a/mopidy/frontends/mpd/ext.conf b/mopidy/mpd/ext.conf similarity index 100% rename from mopidy/frontends/mpd/ext.conf rename to mopidy/mpd/ext.conf diff --git a/mopidy/frontends/mpd/protocol/__init__.py b/mopidy/mpd/protocol/__init__.py similarity index 100% rename from mopidy/frontends/mpd/protocol/__init__.py rename to mopidy/mpd/protocol/__init__.py diff --git a/mopidy/frontends/mpd/protocol/audio_output.py b/mopidy/mpd/protocol/audio_output.py similarity index 90% rename from mopidy/frontends/mpd/protocol/audio_output.py rename to mopidy/mpd/protocol/audio_output.py index ee1782bd..606eb1d3 100644 --- a/mopidy/frontends/mpd/protocol/audio_output.py +++ b/mopidy/mpd/protocol/audio_output.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mopidy.frontends.mpd.exceptions import MpdNoExistError -from mopidy.frontends.mpd.protocol import handle_request +from mopidy.mpd.exceptions import MpdNoExistError +from mopidy.mpd.protocol import handle_request @handle_request(r'disableoutput\ "(?P\d+)"$') diff --git a/mopidy/frontends/mpd/protocol/channels.py b/mopidy/mpd/protocol/channels.py similarity index 93% rename from mopidy/frontends/mpd/protocol/channels.py rename to mopidy/mpd/protocol/channels.py index 1f54a41b..e8efd2a0 100644 --- a/mopidy/frontends/mpd/protocol/channels.py +++ b/mopidy/mpd/protocol/channels.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mopidy.frontends.mpd.protocol import handle_request -from mopidy.frontends.mpd.exceptions import MpdNotImplemented +from mopidy.mpd.protocol import handle_request +from mopidy.mpd.exceptions import MpdNotImplemented @handle_request(r'subscribe\ "(?P[A-Za-z0-9:._-]+)"$') diff --git a/mopidy/frontends/mpd/protocol/command_list.py b/mopidy/mpd/protocol/command_list.py similarity index 95% rename from mopidy/frontends/mpd/protocol/command_list.py rename to mopidy/mpd/protocol/command_list.py index c85a594b..8268c55d 100644 --- a/mopidy/frontends/mpd/protocol/command_list.py +++ b/mopidy/mpd/protocol/command_list.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mopidy.frontends.mpd.protocol import handle_request -from mopidy.frontends.mpd.exceptions import MpdUnknownCommand +from mopidy.mpd.protocol import handle_request +from mopidy.mpd.exceptions import MpdUnknownCommand @handle_request(r'command_list_begin$') diff --git a/mopidy/frontends/mpd/protocol/connection.py b/mopidy/mpd/protocol/connection.py similarity index 91% rename from mopidy/frontends/mpd/protocol/connection.py rename to mopidy/mpd/protocol/connection.py index 734ed37a..2c615e65 100644 --- a/mopidy/frontends/mpd/protocol/connection.py +++ b/mopidy/mpd/protocol/connection.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mopidy.frontends.mpd.protocol import handle_request -from mopidy.frontends.mpd.exceptions import ( +from mopidy.mpd.protocol import handle_request +from mopidy.mpd.exceptions import ( MpdPasswordError, MpdPermissionError) diff --git a/mopidy/frontends/mpd/protocol/current_playlist.py b/mopidy/mpd/protocol/current_playlist.py similarity index 98% rename from mopidy/frontends/mpd/protocol/current_playlist.py rename to mopidy/mpd/protocol/current_playlist.py index d5bf267a..b4e22a61 100644 --- a/mopidy/frontends/mpd/protocol/current_playlist.py +++ b/mopidy/mpd/protocol/current_playlist.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals -from mopidy.frontends.mpd import translator -from mopidy.frontends.mpd.exceptions import ( +from mopidy.mpd import translator +from mopidy.mpd.exceptions import ( MpdArgError, MpdNoExistError, MpdNotImplemented) -from mopidy.frontends.mpd.protocol import handle_request +from mopidy.mpd.protocol import handle_request @handle_request(r'add\ "(?P[^"]*)"$') diff --git a/mopidy/frontends/mpd/protocol/empty.py b/mopidy/mpd/protocol/empty.py similarity index 74% rename from mopidy/frontends/mpd/protocol/empty.py rename to mopidy/mpd/protocol/empty.py index b2bb9482..9b3d6883 100644 --- a/mopidy/frontends/mpd/protocol/empty.py +++ b/mopidy/mpd/protocol/empty.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mopidy.frontends.mpd.protocol import handle_request +from mopidy.mpd.protocol import handle_request @handle_request(r'[\ ]*$') diff --git a/mopidy/frontends/mpd/protocol/music_db.py b/mopidy/mpd/protocol/music_db.py similarity index 98% rename from mopidy/frontends/mpd/protocol/music_db.py rename to mopidy/mpd/protocol/music_db.py index e1d718c0..6e7e3956 100644 --- a/mopidy/frontends/mpd/protocol/music_db.py +++ b/mopidy/mpd/protocol/music_db.py @@ -5,9 +5,9 @@ import itertools import re from mopidy.models import Track -from mopidy.frontends.mpd import translator -from mopidy.frontends.mpd.exceptions import MpdArgError, MpdNotImplemented -from mopidy.frontends.mpd.protocol import handle_request, stored_playlists +from mopidy.mpd import translator +from mopidy.mpd.exceptions import MpdArgError, MpdNotImplemented +from mopidy.mpd.protocol import handle_request, stored_playlists LIST_QUERY = r""" diff --git a/mopidy/frontends/mpd/protocol/playback.py b/mopidy/mpd/protocol/playback.py similarity index 99% rename from mopidy/frontends/mpd/protocol/playback.py rename to mopidy/mpd/protocol/playback.py index 27ee6d4b..c09afde8 100644 --- a/mopidy/frontends/mpd/protocol/playback.py +++ b/mopidy/mpd/protocol/playback.py @@ -1,8 +1,8 @@ from __future__ import unicode_literals from mopidy.core import PlaybackState -from mopidy.frontends.mpd.protocol import handle_request -from mopidy.frontends.mpd.exceptions import ( +from mopidy.mpd.protocol import handle_request +from mopidy.mpd.exceptions import ( MpdArgError, MpdNoExistError, MpdNotImplemented) diff --git a/mopidy/frontends/mpd/protocol/reflection.py b/mopidy/mpd/protocol/reflection.py similarity index 95% rename from mopidy/frontends/mpd/protocol/reflection.py rename to mopidy/mpd/protocol/reflection.py index d5206120..79aa1247 100644 --- a/mopidy/frontends/mpd/protocol/reflection.py +++ b/mopidy/mpd/protocol/reflection.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mopidy.frontends.mpd.exceptions import MpdPermissionError -from mopidy.frontends.mpd.protocol import handle_request, mpd_commands +from mopidy.mpd.exceptions import MpdPermissionError +from mopidy.mpd.protocol import handle_request, mpd_commands @handle_request(r'config$', auth_required=False) diff --git a/mopidy/frontends/mpd/protocol/status.py b/mopidy/mpd/protocol/status.py similarity index 98% rename from mopidy/frontends/mpd/protocol/status.py rename to mopidy/mpd/protocol/status.py index 2fe3a402..96bca6d6 100644 --- a/mopidy/frontends/mpd/protocol/status.py +++ b/mopidy/mpd/protocol/status.py @@ -3,9 +3,9 @@ from __future__ import unicode_literals import pykka from mopidy.core import PlaybackState -from mopidy.frontends.mpd.exceptions import MpdNotImplemented -from mopidy.frontends.mpd.protocol import handle_request -from mopidy.frontends.mpd.translator import track_to_mpd_format +from mopidy.mpd.exceptions import MpdNotImplemented +from mopidy.mpd.protocol import handle_request +from mopidy.mpd.translator import track_to_mpd_format #: Subsystems that can be registered with idle command. SUBSYSTEMS = [ diff --git a/mopidy/frontends/mpd/protocol/stickers.py b/mopidy/mpd/protocol/stickers.py similarity index 94% rename from mopidy/frontends/mpd/protocol/stickers.py rename to mopidy/mpd/protocol/stickers.py index 84417e51..1243d7a6 100644 --- a/mopidy/frontends/mpd/protocol/stickers.py +++ b/mopidy/mpd/protocol/stickers.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mopidy.frontends.mpd.protocol import handle_request -from mopidy.frontends.mpd.exceptions import MpdNotImplemented +from mopidy.mpd.protocol import handle_request +from mopidy.mpd.exceptions import MpdNotImplemented @handle_request( diff --git a/mopidy/frontends/mpd/protocol/stored_playlists.py b/mopidy/mpd/protocol/stored_playlists.py similarity index 96% rename from mopidy/frontends/mpd/protocol/stored_playlists.py rename to mopidy/mpd/protocol/stored_playlists.py index 974dbc7f..6564236e 100644 --- a/mopidy/frontends/mpd/protocol/stored_playlists.py +++ b/mopidy/mpd/protocol/stored_playlists.py @@ -2,9 +2,9 @@ from __future__ import unicode_literals import datetime as dt -from mopidy.frontends.mpd.exceptions import MpdNoExistError, MpdNotImplemented -from mopidy.frontends.mpd.protocol import handle_request -from mopidy.frontends.mpd.translator import playlist_to_mpd_format +from mopidy.mpd.exceptions import MpdNoExistError, MpdNotImplemented +from mopidy.mpd.protocol import handle_request +from mopidy.mpd.translator import playlist_to_mpd_format @handle_request(r'listplaylist\ ("?)(?P[^"]+)\1$') diff --git a/mopidy/frontends/mpd/session.py b/mopidy/mpd/session.py similarity index 93% rename from mopidy/frontends/mpd/session.py rename to mopidy/mpd/session.py index 14173308..5a531a79 100644 --- a/mopidy/frontends/mpd/session.py +++ b/mopidy/mpd/session.py @@ -2,10 +2,10 @@ from __future__ import unicode_literals import logging -from mopidy.frontends.mpd import dispatcher, protocol +from mopidy.mpd import dispatcher, protocol from mopidy.utils import formatting, network -logger = logging.getLogger('mopidy.frontends.mpd') +logger = logging.getLogger('mopidy.mpd') class MpdSession(network.LineProtocol): diff --git a/mopidy/frontends/mpd/translator.py b/mopidy/mpd/translator.py similarity index 99% rename from mopidy/frontends/mpd/translator.py rename to mopidy/mpd/translator.py index 671bfae7..49ebce35 100644 --- a/mopidy/frontends/mpd/translator.py +++ b/mopidy/mpd/translator.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import shlex -from mopidy.frontends.mpd.exceptions import MpdArgError +from mopidy.mpd.exceptions import MpdArgError from mopidy.models import TlTrack # TODO: special handling of local:// uri scheme diff --git a/setup.py b/setup.py index f43981bf..607496b7 100644 --- a/setup.py +++ b/setup.py @@ -41,9 +41,9 @@ setup( 'mopidy-convert-config = mopidy.config.convert:main', ], 'mopidy.ext': [ - 'http = mopidy.frontends.http:Extension [http]', + 'http = mopidy.http:Extension [http]', 'local = mopidy.backends.local:Extension', - 'mpd = mopidy.frontends.mpd:Extension', + 'mpd = mopidy.mpd:Extension', 'stream = mopidy.backends.stream:Extension', ], }, diff --git a/tests/frontends/__init__.py b/tests/frontends/__init__.py deleted file mode 100644 index baffc488..00000000 --- a/tests/frontends/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/tests/frontends/mpd/__init__.py b/tests/frontends/mpd/__init__.py deleted file mode 100644 index baffc488..00000000 --- a/tests/frontends/mpd/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/tests/frontends/http/__init__.py b/tests/http/__init__.py similarity index 100% rename from tests/frontends/http/__init__.py rename to tests/http/__init__.py diff --git a/tests/frontends/http/events_test.py b/tests/http/events_test.py similarity index 97% rename from tests/frontends/http/events_test.py rename to tests/http/events_test.py index 5150db9b..dbfa8413 100644 --- a/tests/frontends/http/events_test.py +++ b/tests/http/events_test.py @@ -15,7 +15,7 @@ except ImportError: ws4py = False if cherrypy and ws4py: - from mopidy.frontends.http import actor + from mopidy.http import actor @unittest.skipUnless(cherrypy, 'cherrypy not found') diff --git a/mopidy/frontends/__init__.py b/tests/mpd/__init__.py similarity index 100% rename from mopidy/frontends/__init__.py rename to tests/mpd/__init__.py diff --git a/tests/frontends/mpd/dispatcher_test.py b/tests/mpd/dispatcher_test.py similarity index 91% rename from tests/frontends/mpd/dispatcher_test.py rename to tests/mpd/dispatcher_test.py index 9ef88e44..13f2d7a5 100644 --- a/tests/frontends/mpd/dispatcher_test.py +++ b/tests/mpd/dispatcher_test.py @@ -6,9 +6,9 @@ import pykka from mopidy import core from mopidy.backends import dummy -from mopidy.frontends.mpd.dispatcher import MpdDispatcher -from mopidy.frontends.mpd.exceptions import MpdAckError -from mopidy.frontends.mpd.protocol import request_handlers, handle_request +from mopidy.mpd.dispatcher import MpdDispatcher +from mopidy.mpd.exceptions import MpdAckError +from mopidy.mpd.protocol import request_handlers, handle_request class MpdDispatcherTest(unittest.TestCase): diff --git a/tests/frontends/mpd/exception_test.py b/tests/mpd/exception_test.py similarity index 97% rename from tests/frontends/mpd/exception_test.py rename to tests/mpd/exception_test.py index 3b42f1b9..ae59253e 100644 --- a/tests/frontends/mpd/exception_test.py +++ b/tests/mpd/exception_test.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import unittest -from mopidy.frontends.mpd.exceptions import ( +from mopidy.mpd.exceptions import ( MpdAckError, MpdPermissionError, MpdUnknownCommand, MpdSystemError, MpdNotImplemented) diff --git a/tests/frontends/mpd/protocol/__init__.py b/tests/mpd/protocol/__init__.py similarity index 98% rename from tests/frontends/mpd/protocol/__init__.py rename to tests/mpd/protocol/__init__.py index aa9a5a6d..9f3b58d6 100644 --- a/tests/frontends/mpd/protocol/__init__.py +++ b/tests/mpd/protocol/__init__.py @@ -7,7 +7,7 @@ import pykka from mopidy import core from mopidy.backends import dummy -from mopidy.frontends.mpd import session +from mopidy.mpd import session class MockConnection(mock.Mock): diff --git a/tests/frontends/mpd/protocol/audio_output_test.py b/tests/mpd/protocol/audio_output_test.py similarity index 97% rename from tests/frontends/mpd/protocol/audio_output_test.py rename to tests/mpd/protocol/audio_output_test.py index 4871f169..643682ef 100644 --- a/tests/frontends/mpd/protocol/audio_output_test.py +++ b/tests/mpd/protocol/audio_output_test.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from tests.frontends.mpd import protocol +from tests.mpd import protocol class AudioOutputHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/authentication_test.py b/tests/mpd/protocol/authentication_test.py similarity index 98% rename from tests/frontends/mpd/protocol/authentication_test.py rename to tests/mpd/protocol/authentication_test.py index 2597ddef..6a39ba81 100644 --- a/tests/frontends/mpd/protocol/authentication_test.py +++ b/tests/mpd/protocol/authentication_test.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from tests.frontends.mpd import protocol +from tests.mpd import protocol class AuthenticationActiveTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/channels_test.py b/tests/mpd/protocol/channels_test.py similarity index 95% rename from tests/frontends/mpd/protocol/channels_test.py rename to tests/mpd/protocol/channels_test.py index 86cf8197..5d4ee670 100644 --- a/tests/frontends/mpd/protocol/channels_test.py +++ b/tests/mpd/protocol/channels_test.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from tests.frontends.mpd import protocol +from tests.mpd import protocol class ChannelsHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/command_list_test.py b/tests/mpd/protocol/command_list_test.py similarity index 98% rename from tests/frontends/mpd/protocol/command_list_test.py rename to tests/mpd/protocol/command_list_test.py index 222dcb61..9d66bd5d 100644 --- a/tests/frontends/mpd/protocol/command_list_test.py +++ b/tests/mpd/protocol/command_list_test.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from tests.frontends.mpd import protocol +from tests.mpd import protocol class CommandListsTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/connection_test.py b/tests/mpd/protocol/connection_test.py similarity index 95% rename from tests/frontends/mpd/protocol/connection_test.py rename to tests/mpd/protocol/connection_test.py index 01deb7a7..452a2147 100644 --- a/tests/frontends/mpd/protocol/connection_test.py +++ b/tests/mpd/protocol/connection_test.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from mock import patch -from tests.frontends.mpd import protocol +from tests.mpd import protocol class ConnectionHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/current_playlist_test.py b/tests/mpd/protocol/current_playlist_test.py similarity index 99% rename from tests/frontends/mpd/protocol/current_playlist_test.py rename to tests/mpd/protocol/current_playlist_test.py index fc4640b1..f94ec6a0 100644 --- a/tests/frontends/mpd/protocol/current_playlist_test.py +++ b/tests/mpd/protocol/current_playlist_test.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from mopidy.models import Track -from tests.frontends.mpd import protocol +from tests.mpd import protocol class CurrentPlaylistHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/idle_test.py b/tests/mpd/protocol/idle_test.py similarity index 98% rename from tests/frontends/mpd/protocol/idle_test.py rename to tests/mpd/protocol/idle_test.py index e6910988..cc937119 100644 --- a/tests/frontends/mpd/protocol/idle_test.py +++ b/tests/mpd/protocol/idle_test.py @@ -2,9 +2,9 @@ from __future__ import unicode_literals from mock import patch -from mopidy.frontends.mpd.protocol.status import SUBSYSTEMS +from mopidy.mpd.protocol.status import SUBSYSTEMS -from tests.frontends.mpd import protocol +from tests.mpd import protocol class IdleHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/music_db_test.py b/tests/mpd/protocol/music_db_test.py similarity index 99% rename from tests/frontends/mpd/protocol/music_db_test.py rename to tests/mpd/protocol/music_db_test.py index 52a7a390..09db53ae 100644 --- a/tests/frontends/mpd/protocol/music_db_test.py +++ b/tests/mpd/protocol/music_db_test.py @@ -2,10 +2,10 @@ from __future__ import unicode_literals import unittest -from mopidy.frontends.mpd.protocol import music_db +from mopidy.mpd.protocol import music_db from mopidy.models import Album, Artist, SearchResult, Track -from tests.frontends.mpd import protocol +from tests.mpd import protocol class QueryFromMpdSearchFormatTest(unittest.TestCase): diff --git a/tests/frontends/mpd/protocol/playback_test.py b/tests/mpd/protocol/playback_test.py similarity index 99% rename from tests/frontends/mpd/protocol/playback_test.py rename to tests/mpd/protocol/playback_test.py index fc91c09c..a572aabe 100644 --- a/tests/frontends/mpd/protocol/playback_test.py +++ b/tests/mpd/protocol/playback_test.py @@ -5,7 +5,7 @@ import unittest from mopidy.core import PlaybackState from mopidy.models import Track -from tests.frontends.mpd import protocol +from tests.mpd import protocol PAUSED = PlaybackState.PAUSED diff --git a/tests/frontends/mpd/protocol/reflection_test.py b/tests/mpd/protocol/reflection_test.py similarity index 98% rename from tests/frontends/mpd/protocol/reflection_test.py rename to tests/mpd/protocol/reflection_test.py index 16f4579f..160c9876 100644 --- a/tests/frontends/mpd/protocol/reflection_test.py +++ b/tests/mpd/protocol/reflection_test.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from tests.frontends.mpd import protocol +from tests.mpd import protocol class ReflectionHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/regression_test.py b/tests/mpd/protocol/regression_test.py similarity index 99% rename from tests/frontends/mpd/protocol/regression_test.py rename to tests/mpd/protocol/regression_test.py index 0bc488fd..3389573f 100644 --- a/tests/frontends/mpd/protocol/regression_test.py +++ b/tests/mpd/protocol/regression_test.py @@ -4,7 +4,7 @@ import random from mopidy.models import Track -from tests.frontends.mpd import protocol +from tests.mpd import protocol class IssueGH17RegressionTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/status_test.py b/tests/mpd/protocol/status_test.py similarity index 96% rename from tests/frontends/mpd/protocol/status_test.py rename to tests/mpd/protocol/status_test.py index 1cf5f253..8ded6938 100644 --- a/tests/frontends/mpd/protocol/status_test.py +++ b/tests/mpd/protocol/status_test.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from mopidy.models import Track -from tests.frontends.mpd import protocol +from tests.mpd import protocol class StatusHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/stickers_test.py b/tests/mpd/protocol/stickers_test.py similarity index 96% rename from tests/frontends/mpd/protocol/stickers_test.py rename to tests/mpd/protocol/stickers_test.py index de610521..31fd5da0 100644 --- a/tests/frontends/mpd/protocol/stickers_test.py +++ b/tests/mpd/protocol/stickers_test.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from tests.frontends.mpd import protocol +from tests.mpd import protocol class StickersHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/protocol/stored_playlists_test.py b/tests/mpd/protocol/stored_playlists_test.py similarity index 99% rename from tests/frontends/mpd/protocol/stored_playlists_test.py rename to tests/mpd/protocol/stored_playlists_test.py index d75944c4..a65b3ed7 100644 --- a/tests/frontends/mpd/protocol/stored_playlists_test.py +++ b/tests/mpd/protocol/stored_playlists_test.py @@ -4,7 +4,7 @@ import datetime from mopidy.models import Track, Playlist -from tests.frontends.mpd import protocol +from tests.mpd import protocol class PlaylistsHandlerTest(protocol.BaseTestCase): diff --git a/tests/frontends/mpd/status_test.py b/tests/mpd/status_test.py similarity index 98% rename from tests/frontends/mpd/status_test.py rename to tests/mpd/status_test.py index d86f7dcd..dea0c479 100644 --- a/tests/frontends/mpd/status_test.py +++ b/tests/mpd/status_test.py @@ -7,8 +7,8 @@ import pykka from mopidy import core from mopidy.backends import dummy from mopidy.core import PlaybackState -from mopidy.frontends.mpd import dispatcher -from mopidy.frontends.mpd.protocol import status +from mopidy.mpd import dispatcher +from mopidy.mpd.protocol import status from mopidy.models import Track diff --git a/tests/frontends/mpd/translator_test.py b/tests/mpd/translator_test.py similarity index 99% rename from tests/frontends/mpd/translator_test.py rename to tests/mpd/translator_test.py index 1db10ab9..c2648311 100644 --- a/tests/frontends/mpd/translator_test.py +++ b/tests/mpd/translator_test.py @@ -4,7 +4,7 @@ import datetime import unittest from mopidy.utils.path import mtime -from mopidy.frontends.mpd import translator +from mopidy.mpd import translator from mopidy.models import Album, Artist, TlTrack, Playlist, Track