diff --git a/docs/index.rst b/docs/index.rst index 7c618dc3..ed92375c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,6 +8,7 @@ Contents changes installation + settings development Indices and tables diff --git a/docs/installation.rst b/docs/installation.rst index f924fd72..bdf523ea 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -143,8 +143,8 @@ Test your libspotify setup:: words before starting Mopidy). -Settings -======== +Spotify settings +================ Create a file name ``local_settings.py`` in the same directory as ``settings.py``. Enter your Spotify Premium account's username and password @@ -160,6 +160,9 @@ libspotify backend, copy the Spotify application key to BACKEND = u'mopidy.backends.libspotify.LibspotifyBackend' +For a full list of available settings, see :mod:`mopidy.settings`. + + Running Mopidy ============== diff --git a/docs/settings.rst b/docs/settings.rst new file mode 100644 index 00000000..b449b247 --- /dev/null +++ b/docs/settings.rst @@ -0,0 +1,8 @@ +******** +Settings +******** + +.. automodule:: mopidy.settings + :synopsis: Available settings and their default values. + :members: + :undoc-members: diff --git a/mopidy/__main__.py b/mopidy/__main__.py index 0d02b416..ee1a3384 100644 --- a/mopidy/__main__.py +++ b/mopidy/__main__.py @@ -14,7 +14,7 @@ logger = logging.getLogger('mopidy') def main(): _setup_logging(2) - backend = _get_backend(config.BACKEND) + backend = _get_backend(config.BACKENDS[0]) MpdServer(backend=backend) asyncore.loop() diff --git a/mopidy/settings.py b/mopidy/settings.py index aa513c81..4e442432 100644 --- a/mopidy/settings.py +++ b/mopidy/settings.py @@ -1,17 +1,60 @@ +""" +Available settings and their default values. + +.. warning:: To users + + Do *not* change settings here. Instead, add a file called + ``mopidy/local_settings.py`` and redefine settings there. + +.. note:: To developers + + When you need to read a setting, import :mod:`mopidy.config` instead of + :mod:`mopidy.settings`. This way basic error handling is done for you, and + a :exc:`mopidy.exceptions.ConfigError` exception is raised if a setting is + not set or is empty when used. +""" + +#: List of playback backends to use. Default:: +#: +#: BACKENDS = (u'mopidy.backends.despotify.DespotifyBackend',) +#: +#: .. note:: +#: Currently only the first backend in the list is used. +#: +BACKENDS = ( + u'mopidy.backends.despotify.DespotifyBackend', + #u'mopidy.backends.libspotify.LibspotifyBackend', +) + +#: The log format used on the console. See +#: http://docs.python.org/library/logging.html#formatter-objects for details on +#: the format. CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(asctime)s [%(threadName)s] %(name)s\n %(message)s' + +#: Encoding used in MPD protocol. *Default:* ``utf-8`` MPD_LINE_ENCODING = u'utf-8' + +#: Line terminator character used in MPD protocol. *Default:* ``\n`` MPD_LINE_TERMINATOR = u'\n' + +#: Which address Mopidy should bind to. Examples: +#: +#: ``localhost`` +#: Listens only on the loopback interface. *Default.* +#: ``0.0.0.0`` +#: listens on all interfaces. MPD_SERVER_HOSTNAME = u'localhost' + +#: Which TCP port Mopidy should listen to. *Default: 6600* MPD_SERVER_PORT = 6600 -BACKEND=u'mopidy.backends.despotify.DespotifyBackend' -#BACKEND=u'mopidy.backends.libspotify.LibspotifyBackend' - +#: Your Spotify Premium username. Used by all Spotify backends. SPOTIFY_USERNAME = u'' + +#: Your Spotify Premium password. Used by all Spotify backends. SPOTIFY_PASSWORD = u'' try: from mopidy.local_settings import * except ImportError: pass -