From 3de39b5a4c9d90d9ece51ce56c5647e8fd8272c5 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 12 Apr 2013 01:06:21 +0200 Subject: [PATCH] docs: Document core config values --- docs/config.rst | 74 +++++++++++++++++++++++++++++++++++++++++++-- mopidy/config.py | 22 +++----------- mopidy/default.conf | 17 +++++++++++ 3 files changed, 93 insertions(+), 20 deletions(-) create mode 100644 mopidy/default.conf diff --git a/docs/config.rst b/docs/config.rst index 6f4877b2..b6cf8402 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -34,13 +34,83 @@ A complete ``~/.config/mopidy/mopidy.conf`` may look as simple as this: Core configuration values ========================= -TODO +.. confval:: audio/mixer + + Audio mixer to use. + + Expects a GStreamer mixer to use, typical values are: ``alsamixer``, + ``pulsemixer``, ``ossmixer``, and ``oss4mixer``. + + Setting this to blank turns off volume control. ``software`` can be used to + force software mixing in the application. + +.. confval:: audio/mixer_track + + Audio mixer track to use. + + Name of the mixer track to use. If this is not set we will try to find the + master output track. As an example, using ``alsamixer`` you would typically + set this to ``Master`` or ``PCM``. + +.. confval:: audio/output + + Audio output to use. + + Expects a GStreamer sink. Typical values are ``autoaudiosink``, + ``alsasink``, ``osssink``, ``oss4sink``, ``pulsesink``, and ``shout2send``, + and additional arguments specific to each sink. You can use the command + ``gst-inspect-0.10`` to see what output properties can be set on the sink. + For example: ``gst-inspect-0.10 shout2send`` + +.. confval:: logging/console_format + + The log format used for informational logging. + + See `the Python logging docs + `_ for + details on the format. + +.. confval:: logging/debug_format + + The log format used for debug logging. + + See `the Python logging docs + `_ for + details on the format. + +.. confval:: logging/debug_file + + The file to dump debug log data to when Mopidy is run with the + :option:`--save-debug-log` option. + +.. confval:: logging.levels/* + + The ``logging.levels`` config section can be used to change the log level + for specific parts of Mopidy during development or debugging. Each key in + the config section should match the name of a logger. The value is the log + level to use for that logger, one of ``debug``, ``info``, ``warning``, + ``error``, or ``critical``. + +.. confval:: proxy/hostname + + Proxy server to use for communication with the Internet. + + Currently only used by the Spotify extension. + +.. confval:: proxy/username + + Username for the proxy server, if required. + +.. confval:: proxy/password + + Password for the proxy server, if required. Default core configuration ========================== -TODO +.. literalinclude:: ../mopidy/default.conf + :language: ini Advanced configurations diff --git a/mopidy/config.py b/mopidy/config.py index 88fc3419..04c7c16e 100644 --- a/mopidy/config.py +++ b/mopidy/config.py @@ -1,27 +1,13 @@ from __future__ import unicode_literals +import os + from mopidy.utils import config -default_config = """ -[logging] -console_format = %(levelname)-8s %(message)s -debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s -debug_file = mopidy.log +default_config_file = os.path.join(os.path.dirname(__file__), 'default.conf') +default_config = open(default_config_file).read() -[logging.levels] -pykka = info - -[audio] -mixer = autoaudiomixer -mixer_track = -output = autoaudiosink - -[proxy] -hostname = -username = -password = -""" config_schemas = {} # TODO: use ordered dict? config_schemas['logging'] = config.ConfigSchema() diff --git a/mopidy/default.conf b/mopidy/default.conf new file mode 100644 index 00000000..1d7d7338 --- /dev/null +++ b/mopidy/default.conf @@ -0,0 +1,17 @@ +[logging] +console_format = %(levelname)-8s %(message)s +debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s +debug_file = mopidy.log + +[logging.levels] +pykka = info + +[audio] +mixer = autoaudiomixer +mixer_track = +output = autoaudiosink + +[proxy] +hostname = +username = +password =