linotp.lib.registry module

class linotp.lib.registry.ClassRegistry

Bases: dict

A simple class registry, that provides a convenient decorator.

Usage:

>>> cls_reg = ClassRegistry()
>>> cls_reg.class_entry(registry_key='foo_cls')
>>> class Foo (object):
>>>    pass
class_entry(registry_key=None)

decorator factory to insert classes into this registry