# 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
        doc='Suppress output of a manifest file (default false)'
    )
    
    def __init__(self, config, local_config):
        super(FilesystemOutput, self).__init__(config, local_config)
        self.component = filesystem.FilesystemProducerImpl(
            dirpath=self.config.folder,
            file_name_pattern=self.config.filename_pattern,
            message_file_name_pattern=self.config.message_filename_pattern,
            circular_buf_size=self.config.rotating_buf,
            suppress_manifest=self.config.suppress_manifest)



class FilesystemInput(ConfigurableComponent):

    required_config = Namespace()
    required_config.add_option('manifest_file', doc='The timing manifest file for importing files')
    required_config.add_option(
        'tail',
        doc='Keep the manifest open and wait for new input much like UNIX\'s tail -f command'
    )
    _fs_reader = None

    def __init__(self, config, local_config):
        super(FilesystemInput, self).__init__(config, local_config)
        self.component = filesystem.FilesystemConsumerImpl()
        self._fs_reader = filesystem.FilesystemReader(
            manifest_path=self.config.manifest_file,
            do_tail=self.config.tail,

# 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

        doc='Suppress output of a manifest file (default false)'
    )
    
    def __init__(self, config, local_config):
        super(FilesystemOutput, self).__init__(config, local_config)
        self.component = filesystem.FilesystemProducerImpl(
            dirpath=self.config.folder,
            file_name_pattern=self.config.filename_pattern,
            message_file_name_pattern=self.config.message_filename_pattern,
            circular_buf_size=self.config.rotating_buf,
            suppress_manifest=self.config.suppress_manifest)



class FilesystemInput(ConfigurableComponent):

    required_config = Namespace()
    required_config.add_option('manifest_file', doc='The timing manifest file for importing files')
    required_config.add_option(
        'tail',
        doc='Keep the manifest open and wait for new input much like UNIX\'s tail -f command'
    )
    _fs_reader = None

    def __init__(self, config, local_config):
        super(FilesystemInput, self).__init__(config, local_config)
        self.component = filesystem.FilesystemConsumerImpl()
        self._fs_reader = filesystem.FilesystemReader(
            manifest_path=self.config.manifest_file,
            do_tail=self.config.tail,

            custom_consumer=self.component