Registry

Inheritance diagram of Registry

Registry inheritance diagram

class savant.utils.registry.Registry(name)

The registry that provides name -> object mapping.

To create a registry (e.g. a sink registry):

SINK_REGISTRY = Registry('sink')

To register an object:

@SINK_REGISTRY.register('mysink')
class MySink:
    ...

Or:

SINK_REGISTRY.register('mysink', MySink)
register(name, obj=None)

Register the given object under the name.

Can be used as a decorator.

get(name)

Try to get name from registry.