# 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
        default=CFG_FILENAME_PATTERN,
        doc='File name pattern. It needs to contain {counter} format parameter.'
    )
    required_config.add_option(
        'message_filename_pattern',
        default=CFG_MESSAGE_PATTERN,
        doc='File name pattern. It needs to contain {counter} format parameter.'
    )
    required_config.add_option(
        'rotating_buf',
        default=0,
        doc='Rotating buffer size. This will keep the last N number of files created in the folder or all if N is zero.'
    )
    required_config.add_option(
        'suppress_manifest',
        default=False,
        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)




# 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

        default=CFG_FILENAME_PATTERN,
        doc='File name pattern. It needs to contain {counter} format parameter.'
    )
    required_config.add_option(
        'message_filename_pattern',
        default=CFG_MESSAGE_PATTERN,
        doc='File name pattern. It needs to contain {counter} format parameter.'
    )
    required_config.add_option(
        'rotating_buf',
        default=0,
        doc='Rotating buffer size. This will keep the last N number of files created in the folder or all if N is zero.'
    )
    required_config.add_option(
        'suppress_manifest',
        default=False,
        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):