nCoda Lychee Docs

Outbound Format Registrar

Registrar: an object to manage registrations of outbound data formats.

Every InteractiveSession instance uses its own Registrar instance.

class lychee.workflow.registrar.Registrar[source]

Manage registrations of data formats for production during outbound conversion.

This class does not manage format conversion. This class accepts registrations and unregistrations, and also produces a list of the formats that are currently registered.

The “who” part of registrations allows Lychee to disambiguate multiple interface components that require data in the same format. If one component registers without a who argument, and another component unregisters without a who argument, Registrar cannot know that these actions were requested by different components. However, if each interface component uses a unique “who” argument, Registrar will ensure the data format is always produced until all registered components have unregistered themselves.

get_registered_formats()[source]

Return a list of the formats that are currently registered for outbound conversion.

Returns:The list.
Return type:list of str
register(dtype, who=None, outbound=False, **kwargs)[source]

Register a format for outbound conversion.

Parameters:
  • dtype (str) – The format to register for conversion.
  • who (str) – An optional identifying string.
  • outbound (bool) – An optional “True” to specify that the “ACTION_START” signal should be emitted after registering the outbound format, which will run the outbound step.

If dtype does not have a converter listed in lychee.converters.OUTBOUND_CONVERTERS, the format will not be registered and WARN message will be written to the log.

unregister(dtype, who=None, **kwargs)[source]

Unregister a format from outbound conversion.

Parameters:
  • dtype (str) – The format to register for conversion.
  • who (str) – An optional identifying string.

If the dtype and who combination are not currently registered for outbound conversion, a DEBUG message will be written to the log.