3 \¼meþã@sddlZGdd„dƒZdS)éNc@s>eZdZdZdd„Zdd„Zdd„Zdd d „Zed d „ƒZ d S)Ú DictRegistryz+A simple registry for a mapping of objects.cCs |jƒdS)N)Úreset)Úself©rú/usr/lib/python3.6/registry.pyÚ__init__ szDictRegistry.__init__cCs i|_dS)N)Ú_items)rrrrrszDictRegistry.resetcCs&||jkrtdj|ƒƒ‚||j|<dS)zAdd item to the registry.z$Item already registered with key {0}N)rÚ ValueErrorÚformat)rÚkeyÚitemrrrÚ register_items  zDictRegistry.register_itemTcCs(||jkr|j|=n|s$td|ƒ‚dS)zRemove item from the registry.z!%s: key not present to unregisterN)rÚKeyError)rr ÚforcerrrÚunregister_items  zDictRegistry.unregister_itemcCs tj|jƒS)zvAll the items that have been registered. This cannot be used to modify the contents of the registry. )Úcopyr)rrrrÚregistered_items szDictRegistry.registered_itemsN)T) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr rÚpropertyrrrrrrs  r)rrrrrrÚs