# Path: ebu_tt_live/config/common.py
# class ConfigurableComponent(RequiredConfig):
#     def __init__(self, config, local_config, backend=None):
#     def backend(self):
#     def configure_component(cls, config, local_config, **kwargs):
#     def _resolve_runtime_variable_match(cls, matchobj):
#     def resolve_runtime_variables(cls, str_parameter):
#     def start(self):
#     def stop(self):
# def install_app(app_obj):
# 
# Path: ebu_tt_live/strings.py
# ERR_CONF_PROXY_CONF_VALUE = gettext('Failed to parse proxy config: {value}')
# 
# ERR_NO_SUCH_COMPONENT = gettext('No such component: {type_name}')
# 
# Path: ebu_tt_live/errors.py
# class ConfigurationError(Exception):
#     pass
# 
# Path: ebu_tt_live/strings.py
# CFG_FILENAME_PATTERN = gettext('{sequence_identifier}_{counter}.xml')
# 
# CFG_MESSAGE_PATTERN = gettext('{sequence_identifier}_msg_{counter}.xml')


from .common import ConfigurableComponent, Namespace
from ebu_tt_live.carriage.direct import DirectCarriageImpl
from ebu_tt_live.carriage.websocket import WebsocketProducerCarriage, WebsocketConsumerCarriage
from ebu_tt_live.carriage import filesystem
from ebu_tt_live.strings import ERR_CONF_PROXY_CONF_VALUE, ERR_NO_SUCH_COMPONENT
from ebu_tt_live.errors import ConfigurationError
from ebu_tt_live.strings import CFG_FILENAME_PATTERN, CFG_MESSAGE_PATTERN
import urlparse
import re
    'websocket-legacy': WebsocketLegacyOutput,
    'filesystem': FilesystemOutput,
    'direct': DirectOutput
}


def get_producer_carriage(carriage_type):
    try:
        return producer_carriage_by_type[carriage_type]
    except KeyError:
        raise ConfigurationError(
            ERR_NO_SUCH_COMPONENT.format(
                type_name=carriage_type
            )
        )


consumer_carriage_by_type = {
    'websocket': WebsocketInput,
    'websocket-legacy': WebsocketLegacyInput,
    'direct': DirectInput,
    'filesystem':  FilesystemInput
}


def get_consumer_carriage(carriage_type):
    try:
        return consumer_carriage_by_type[carriage_type]
    except KeyError:
        raise ConfigurationError(

# Path: ebu_tt_live/config/common.py
# class ConfigurableComponent(RequiredConfig):
#     def __init__(self, config, local_config, backend=None):
#     def backend(self):
#     def configure_component(cls, config, local_config, **kwargs):
#     def _resolve_runtime_variable_match(cls, matchobj):
#     def resolve_runtime_variables(cls, str_parameter):
#     def start(self):
#     def stop(self):
# def install_app(app_obj):
# 
# Path: ebu_tt_live/strings.py
# ERR_CONF_PROXY_CONF_VALUE = gettext('Failed to parse proxy config: {value}')
# 
# ERR_NO_SUCH_COMPONENT = gettext('No such component: {type_name}')
# 
# Path: ebu_tt_live/errors.py
# class ConfigurationError(Exception):
#     pass
# 
# Path: ebu_tt_live/strings.py
# CFG_FILENAME_PATTERN = gettext('{sequence_identifier}_{counter}.xml')
# 
# CFG_MESSAGE_PATTERN = gettext('{sequence_identifier}_msg_{counter}.xml')


# Path: ebu_tt_live/config/carriage.py
from .common import ConfigurableComponent, Namespace
from ebu_tt_live.carriage.direct import DirectCarriageImpl
from ebu_tt_live.carriage.websocket import WebsocketProducerCarriage, WebsocketConsumerCarriage
from ebu_tt_live.carriage import filesystem
from ebu_tt_live.strings import ERR_CONF_PROXY_CONF_VALUE, ERR_NO_SUCH_COMPONENT
from ebu_tt_live.errors import ConfigurationError
from ebu_tt_live.strings import CFG_FILENAME_PATTERN, CFG_MESSAGE_PATTERN
import urlparse
import re

    'websocket-legacy': WebsocketLegacyOutput,
    'filesystem': FilesystemOutput,
    'direct': DirectOutput
}


def get_producer_carriage(carriage_type):
    try:
        return producer_carriage_by_type[carriage_type]
    except KeyError:
        raise ConfigurationError(
            ERR_NO_SUCH_COMPONENT.format(
                type_name=carriage_type
            )
        )


consumer_carriage_by_type = {
    'websocket': WebsocketInput,
    'websocket-legacy': WebsocketLegacyInput,
    'direct': DirectInput,
    'filesystem':  FilesystemInput
}


def get_consumer_carriage(carriage_type):
    try:
        return consumer_carriage_by_type[carriage_type]
    except KeyError:
        raise ConfigurationError(

            ERR_NO_SUCH_COMPONENT.format(