docs: Moved the Mopidy settings file

This commit is contained in:
Stein Magnus Jodal 2010-03-23 00:44:15 +01:00
parent 79b5942831
commit 9a09692e99
4 changed files with 17 additions and 11 deletions

View File

@ -7,11 +7,11 @@ Changing settings
================= =================
For any Mopidy installation you will need to change at least a couple of For any Mopidy installation you will need to change at least a couple of
settings. To do this, create a new file in the ``mopidy/settings/`` directory settings. To do this, create a new file in the ``~/.mopidy/`` directory
named ``local.py`` and add settings you need to change from their defaults named ``settings.py`` and add settings you need to change from their defaults
there. there.
A complete ``mopidy/settings/local.py`` may look like this:: A complete ``~/.mopidy/settings.py`` may look like this::
MPD_SERVER_HOSTNAME = u'0.0.0.0' MPD_SERVER_HOSTNAME = u'0.0.0.0'
SPOTIFY_USERNAME = u'alice' SPOTIFY_USERNAME = u'alice'

View File

@ -55,7 +55,7 @@ And on OS X, assuming you allready got git installed, e.g. from Homebrew::
Spotify settings Spotify settings
================ ================
Create a file named ``local.py`` in the directory ``mopidy/settings/``. Enter Create a file named ``settings.py`` in the directory ``~/.mopidy/``. Enter
your Spotify Premium account's username and password into the file, like this:: your Spotify Premium account's username and password into the file, like this::
SPOTIFY_USERNAME = u'myusername' SPOTIFY_USERNAME = u'myusername'
@ -68,7 +68,7 @@ Switching backend
Currently the despotify backend is the default. If you want to use the Currently the despotify backend is the default. If you want to use the
libspotify backend instead, copy the Spotify application key to libspotify backend instead, copy the Spotify application key to
``mopidy/spotify_appkey.key``, and add the following to ``mopidy/spotify_appkey.key``, and add the following to
``mopidy/mopidy/settings/local.py``:: ``~/.mopidy/settings.py``::
BACKENDS = (u'mopidy.backends.libspotify.LibspotifyBackend',) BACKENDS = (u'mopidy.backends.libspotify.LibspotifyBackend',)

View File

@ -1,6 +1,12 @@
from mopidy.settings.default import * import os
try: from mopidy.settings.default import *
from mopidy.settings.local import * from mopidy.utils import get_or_create_dotdir
except ImportError:
pass dotdir = get_or_create_dotdir()
settings_file = os.path.join(dotdir, u'settings.py')
if not os.path.isfile(settings_file):
logger.warning(u'Settings not found: %s', settings_file)
else:
sys.path.insert(0, dotdir)
from settings import *

View File

@ -4,7 +4,7 @@ Available settings and their default values.
.. warning:: .. warning::
Do *not* change settings in ``mopidy/settings/default.py``. Instead, add a Do *not* change settings in ``mopidy/settings/default.py``. Instead, add a
file called ``mopidy/settings/local.py`` and redefine settings there. file called ``~/.mopidy/settings.py`` and redefine settings there.
""" """
import sys import sys