config Package - Component configurators

config Package

This subpackage is meant to contain configuration directives of validation and normalization as well as defaults. The current plan is to use mozilla/configman package. Ultimately there is one goal there. Avoid any runtime errors because of a broken configuration value being used at a later stage in execution at which point due to not having been validated would cause the system to break. Validation and normalization eliminates this problem completely. This means At startup time we can be sure that all of the configuration values match the requirements of successful operation.

Further on there is the requirement of the code to be independent from the configurator. The code needs to be written in a way that the modules are self-contained and only expect their dependencies to have a particular interface but not knowing about the details of their configuration. Therefore in the modules dependency injection is used. In turn however these configurator classes are here to make sure the configuration is possible via a single structured configuration file or environment variables or command line argument overrides.

The mozilla/configman package gives a modular way of writing a complex configuration factory that is controllable by file, environment and command line arguments. This gives great flexibility as the configuration of the individual modules can be self-contained as much as possible yet it is possible to have system-wide configuration parameters, such as a HTTP proxy.

backend module

class ebu_tt_live.config.backend.BackendBase(config, local_config)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

call_once(func, delay=0.0, result_callback=None, error_callback=None, *args, **kwargs)[source]
call_periodically(func, interval=0.0, result_callback=None, error_callback=None, *args, **kwargs)[source]
register_component_start(component)[source]
register_configurator(configurator)[source]
start()[source]
class ebu_tt_live.config.backend.DummyBackend(config, local_config)[source]

Bases: ebu_tt_live.config.backend.BackendBase

call_once(func, delay=0.0, result_callback=None, error_callback=None, *args, **kwargs)[source]
call_periodically(func, interval=0.0, result_callback=None, error_callback=None, *args, **kwargs)[source]
class ebu_tt_live.config.backend.TwistedBackend(config, local_config)[source]

Bases: ebu_tt_live.config.backend.BackendBase

call_once(func, delay=0.0, result_callback=None, error_callback=None, *args, **kwargs)[source]
call_periodically(func, interval=0.0, result_callback=None, error_callback=None, *args, **kwargs)[source]
required_config = <configman.namespace.Namespace object>
start()[source]
ws_backend_consumer(custom_consumer, listen=None, connect=None, proxy=None)[source]
ws_backend_producer(custom_producer, listen=None, connect=None, proxy=None)[source]
The following cases to be considered.
  1. There is listen address
    1.1. The address is used by another producer: ERROR 1.2. The address is used by another protocol: ERROR 1.3. The address is used by a consumer server: create producer and assign it to the factory 1.4. The address is not in use: Create factory and create producer
  2. There are connections to make with publish action
    2.1 There is a producer from the server. Use that. Create client factories with it. 2.2 There is no producer from the server. Create producer, create client factories with it.
Parameters:
  • custom_producer
  • listen
  • connect
  • proxy
Returns:

The Twisted Producer instance with server socket and/or client connections

wsl_backend_consumer(uri, custom_consumer, proxy=None)[source]
wsl_backend_producer(uri, custom_producer)[source]
class ebu_tt_live.config.backend.UniversalBackend[source]

Bases: configman.required_config.RequiredConfig

backend = <configman.namespace.Namespace object>
required_config = <configman.namespace.Namespace object>
ebu_tt_live.config.backend.get_backend(backend_name)[source]

node module

class ebu_tt_live.config.node.BufferDelay(config, local_config)[source]

Bases: ebu_tt_live.config.node.ConsumerMixin, ebu_tt_live.config.node.ProducerMixin, ebu_tt_live.config.node.NodeBase

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.ConsumerMixin[source]

Bases: configman.required_config.RequiredConfig

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.DeDuplicator(config, local_config)[source]

Bases: ebu_tt_live.config.node.ConsumerMixin, ebu_tt_live.config.node.ProducerMixin, ebu_tt_live.config.node.NodeBase

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.Distributor(config, local_config)[source]

Bases: ebu_tt_live.config.node.ConsumerMixin, ebu_tt_live.config.node.ProducerMixin, ebu_tt_live.config.node.NodeBase

class ebu_tt_live.config.node.EBUTTDEncoder(config, local_config)[source]

Bases: ebu_tt_live.config.node.ProducerMixin, ebu_tt_live.config.node.ConsumerMixin, ebu_tt_live.config.node.NodeBase

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.Handover(config, local_config)[source]

Bases: ebu_tt_live.config.node.ConsumerMixin, ebu_tt_live.config.node.ProducerMixin, ebu_tt_live.config.node.NodeBase

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.NodeBase(config, local_config, backend=None)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.ProducerMixin[source]

Bases: configman.required_config.RequiredConfig

output = None
required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.ReSequencer(config, local_config)[source]

Bases: ebu_tt_live.config.node.ProducerMixin, ebu_tt_live.config.node.ConsumerMixin, ebu_tt_live.config.node.NodeBase

required_config = <configman.namespace.Namespace object>
start()[source]
class ebu_tt_live.config.node.RetimingDelay(config, local_config)[source]

Bases: ebu_tt_live.config.node.ConsumerMixin, ebu_tt_live.config.node.ProducerMixin, ebu_tt_live.config.node.NodeBase

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.SimpleConsumer(config, local_config)[source]

Bases: ebu_tt_live.config.node.ConsumerMixin, ebu_tt_live.config.node.NodeBase

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.SimpleProducer(config, local_config)[source]

Bases: ebu_tt_live.config.node.ProducerMixin, ebu_tt_live.config.node.NodeBase

required_config = <configman.namespace.Namespace object>
start()[source]
class ebu_tt_live.config.node.UniversalNode[source]

Bases: configman.required_config.RequiredConfig

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.UniversalNodeList(config, local_config, backend=None)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

classmethod configure_component(config, local_config, **kwargs)[source]

This is a class method to either return an instance that already exists or create one. :param config: :param local_config: :param kwargs: Extra parameters :return: Instance of ConfigurableComponent

node1 = <configman.namespace.Namespace object>
node2 = <configman.namespace.Namespace object>
node3 = <configman.namespace.Namespace object>
node4 = <configman.namespace.Namespace object>
node5 = <configman.namespace.Namespace object>
node6 = <configman.namespace.Namespace object>
node7 = <configman.namespace.Namespace object>
required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.node.UniversalNodes[source]

Bases: configman.required_config.RequiredConfig

required_config = <configman.namespace.Namespace object>
ebu_tt_live.config.node.get_node(node_type)[source]

carriage Package

class ebu_tt_live.config.carriage.DirectCommon(config, local_config, **kwargs)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

classmethod configure_component(config, local_config, **kwargs)[source]

This is a class method to either return an instance that already exists or create one. :param config: :param local_config: :param kwargs: Extra parameters :return: Instance of ConfigurableComponent

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.carriage.DirectInput(config, local_config, **kwargs)[source]

Bases: ebu_tt_live.config.carriage.DirectCommon

class ebu_tt_live.config.carriage.DirectOutput(config, local_config, **kwargs)[source]

Bases: ebu_tt_live.config.carriage.DirectCommon

class ebu_tt_live.config.carriage.FilesystemInput(config, local_config)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

required_config = <configman.namespace.Namespace object>
start()[source]
class ebu_tt_live.config.carriage.FilesystemOutput(config, local_config)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.carriage.WebsocketBase(config, local_config, backend=None)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.carriage.WebsocketInput(config, local_config)[source]

Bases: ebu_tt_live.config.carriage.WebsocketBase

required_config = <configman.namespace.Namespace object>
start()[source]
class ebu_tt_live.config.carriage.WebsocketLegacyBase(config, local_config, backend=None)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

required_config = <configman.namespace.Namespace object>
class ebu_tt_live.config.carriage.WebsocketLegacyInput(config, local_config)[source]

Bases: ebu_tt_live.config.carriage.WebsocketLegacyBase

required_config = <configman.namespace.Namespace object>
start()[source]
class ebu_tt_live.config.carriage.WebsocketLegacyOutput(config, local_config)[source]

Bases: ebu_tt_live.config.carriage.WebsocketLegacyBase

start()[source]
class ebu_tt_live.config.carriage.WebsocketOutput(config, local_config)[source]

Bases: ebu_tt_live.config.carriage.WebsocketBase

required_config = <configman.namespace.Namespace object>
start()[source]
ebu_tt_live.config.carriage.get_consumer_carriage(carriage_type)[source]
ebu_tt_live.config.carriage.get_producer_carriage(carriage_type)[source]
ebu_tt_live.config.carriage.parse_proxy_address(value)[source]
ebu_tt_live.config.carriage.parse_url_list(value)[source]
ebu_tt_live.config.carriage.str_to_url_converter(value)[source]

adapters module

class ebu_tt_live.config.adapters.ConsumerNodeCarriageAdapter(config, local_config, backend=None)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

classmethod configure_component(config, local_config, consumer=None, carriage=None, **kwargs)[source]

This is a class method to either return an instance that already exists or create one. :param config: :param local_config: :param kwargs: Extra parameters :return: Instance of ConfigurableComponent

class ebu_tt_live.config.adapters.ProducerNodeCarriageAdapter(config, local_config, backend=None)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

classmethod configure_component(config, local_config, producer=None, carriage=None, **kwargs)[source]

This is a class method to either return an instance that already exists or create one. :param config: :param local_config: :param kwargs: Extra parameters :return: Instance of ConfigurableComponent

ebu_tt_live.config.adapters.parse_adapter_list(value)[source]

clocks module

class ebu_tt_live.config.clocks.DummyClock(config, local_config, backend=None)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

This wrapper returns None for reference clock allowing the consumer to create a reference clock from the first document received

component = None
class ebu_tt_live.config.clocks.LocalMachineClock(config, local_config)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

class ebu_tt_live.config.clocks.UTCClock(config, local_config)[source]

Bases: ebu_tt_live.config.common.ConfigurableComponent

ebu_tt_live.config.clocks.get_clock(clock_type)[source]

common module

class ebu_tt_live.config.common.ConfigurableComponent(config, local_config, backend=None)[source]

Bases: configman.required_config.RequiredConfig

backend
component = None
config = None
classmethod configure_component(config, local_config, **kwargs)[source]

This is a class method to either return an instance that already exists or create one. :param config: :param local_config: :param kwargs: Extra parameters :return: Instance of ConfigurableComponent

required_config = <configman.namespace.Namespace object>
classmethod resolve_runtime_variables(str_parameter)[source]
start()[source]
stop()[source]
ebu_tt_live.config.common.install_app(app_obj)[source]