<commit_before>from __future__ import unicode_literals

import mopidy
from mopidy import ext


__doc__ = """A backend for playing music for streaming music.

This backend will handle streaming of URIs in
:attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are
installed.

**Issues:**

https://github.com/mopidy/mopidy/issues?labels=Stream+backend

**Dependencies:**

- None

**Settings:**

- :attr:`mopidy.settings.STREAM_PROTOCOLS`
"""


class Extension(ext.Extension):

    name = 'Mopidy-Stream'
    version = mopidy.__version__

    def get_default_config(self):
        return '[ext.stream]'

    def validate_config(self, config):
        pass

    def validate_environment(self):
        pass
<commit_msg>stream: Add default config and config schema<commit_after>from __future__ import unicode_literals

import mopidy
from mopidy import ext
from mopidy.utils import config, formatting


default_config = """
[ext.stream]

# If the stream extension should be enabled or not
enabled = true

# Whitelist of URI schemas to support streaming from
protocols =
    http
    https
    mms
    rtmp
    rtmps
    rtsp
"""

__doc__ = """A backend for playing music for streaming music.

This backend will handle streaming of URIs in
:attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are
installed.

**Issues:**

https://github.com/mopidy/mopidy/issues?labels=Stream+backend

**Dependencies:**

- None

**Default config:**

.. code-block:: ini

%(config)s
""" % {'config': formatting.indent(default_config)}


class Extension(ext.Extension):

    name = 'Mopidy-Stream'
    version = mopidy.__version__

    def get_default_config(self):
        return default_config

    def get_config_schema(self):
        schema = config.ExtensionConfigSchema()
        schema['protocols'] = config.List()
        return schema

    def validate_environment(self):
        pass

{'fraction_non_alphanumeric': 0.09757383966244726, 'fraction_numerical': 0.0, 'mean_word_length': 3.8766066838046274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3378989', 'n_tokens_mistral': 586, 'n_tokens_neox': 562, 'n_words': 162}