From 8bcf1de21c51ec0bdc24409e848244e2fdd0d302 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 12 Apr 2013 00:13:22 +0200 Subject: [PATCH] docs: Move stream to ext registry --- docs/ext/stream.rst | 42 ++++++++++++++++++++++++ docs/index.rst | 8 ++--- docs/modules/backends/stream.rst | 9 ------ mopidy/backends/stream/__init__.py | 52 +++--------------------------- mopidy/backends/stream/ext.conf | 9 ++++++ 5 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 docs/ext/stream.rst delete mode 100644 docs/modules/backends/stream.rst create mode 100644 mopidy/backends/stream/ext.conf diff --git a/docs/ext/stream.rst b/docs/ext/stream.rst new file mode 100644 index 00000000..3d7ea7d3 --- /dev/null +++ b/docs/ext/stream.rst @@ -0,0 +1,42 @@ +.. _ext-stream: + +************* +Mopidy-Stream +************* + +Extension for playing streaming music. + +The stream backend will handle streaming of URIs matching the +:confval:`stream/protocols` config value, assuming the needed GStreamer plugins +are installed. + + +Known issues +============ + +https://github.com/mopidy/mopidy/issues?labels=Stream+backend + + +Dependencies +============ + +None. The extension just needs Mopidy. + + +Configuration values +==================== + +.. confval:: stream/enabled + + If the stream extension should be enabled or not. + +.. confval:: stream/protocols + + Whitelist of URI schemas to allow streaming from. + + +Default configuration +===================== + +.. literalinclude:: ../../mopidy/backends/stream/ext.conf + :language: ini diff --git a/docs/index.rst b/docs/index.rst index e5d21385..16518f53 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,10 +4,10 @@ Mopidy Mopidy is a music server which can play music both from multiple sources, like your :ref:`local hard drive `, :ref:`radio streams -`, and from :ref:`Spotify ` and SoundCloud. -Searches combines results from all music sources, and you can mix tracks from -all sources in your play queue. Your playlists from Spotify or SoundCloud are -also available for use. +`, and from :ref:`Spotify ` and SoundCloud. Searches +combines results from all music sources, and you can mix tracks from all +sources in your play queue. Your playlists from Spotify or SoundCloud are also +available for use. To control your Mopidy music server, you can use one of Mopidy's :ref:`web clients `, the :ref:`Ubuntu Sound Menu `, any diff --git a/docs/modules/backends/stream.rst b/docs/modules/backends/stream.rst deleted file mode 100644 index 2843a7e9..00000000 --- a/docs/modules/backends/stream.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. _stream-backend: - -*********************************************** -:mod:`mopidy.backends.stream` -- Stream backend -*********************************************** - -.. automodule:: mopidy.backends.stream - :synopsis: Backend for playing audio streams - :members: diff --git a/mopidy/backends/stream/__init__.py b/mopidy/backends/stream/__init__.py index 11918500..904c9a7f 100644 --- a/mopidy/backends/stream/__init__.py +++ b/mopidy/backends/stream/__init__.py @@ -1,53 +1,10 @@ from __future__ import unicode_literals +import os + import mopidy from mopidy import ext -from mopidy.utils import config, formatting - - -default_config = """ -[stream] -enabled = true -protocols = - http - https - mms - rtmp - rtmps - rtsp -""" - -__doc__ = """ -A backend for playing music for streaming music. - -This backend will handle streaming of URIs matching the -:confval:`stream/protocols` config value, assuming the needed GStreamer plugins -are installed. - -**Issues** - -https://github.com/mopidy/mopidy/issues?labels=Stream+backend - -**Dependencies** - -None - -**Configuration** - -.. confval:: stream/enabled - - If the stream extension should be enabled or not. - -.. confval:: stream/protocols - - Whitelist of URI schemas to allow streaming from. - -**Default config** - -.. code-block:: ini - -%(config)s -""" % {'config': formatting.indent(default_config)} +from mopidy.utils import config class Extension(ext.Extension): @@ -57,7 +14,8 @@ class Extension(ext.Extension): version = mopidy.__version__ def get_default_config(self): - return default_config + conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') + return open(conf_file).read() def get_config_schema(self): schema = config.ExtensionConfigSchema() diff --git a/mopidy/backends/stream/ext.conf b/mopidy/backends/stream/ext.conf new file mode 100644 index 00000000..9caafac1 --- /dev/null +++ b/mopidy/backends/stream/ext.conf @@ -0,0 +1,9 @@ +[stream] +enabled = true +protocols = + http + https + mms + rtmp + rtmps + rtsp