docs: Document settings

This commit is contained in:
Stein Magnus Jodal 2010-02-21 16:15:46 +01:00
parent 9a88cd0dfa
commit b45fe37a0f
5 changed files with 62 additions and 7 deletions

View File

@ -8,6 +8,7 @@ Contents
changes
installation
settings
development
Indices and tables

View File

@ -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
==============

8
docs/settings.rst Normal file
View File

@ -0,0 +1,8 @@
********
Settings
********
.. automodule:: mopidy.settings
:synopsis: Available settings and their default values.
:members:
:undoc-members:

View File

@ -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()

View File

@ -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