
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
3
\me                 @   s   d dl Z G dd dZdS )    Nc               @   s>   e Zd ZdZdd Zdd Zdd Zdd	d
Zedd Z	dS )DictRegistryz+A simple registry for a mapping of objects.c             C   s   | j   d S )N)reset)self r   /usr/lib/python3.6/registry.py__init__   s    zDictRegistry.__init__c             C   s
   i | _ d S )N)_items)r   r   r   r   r      s    zDictRegistry.resetc             C   s&   || j krtdj||| j |< dS )zAdd item to the registry.z$Item already registered with key {0}N)r   
ValueErrorformat)r   keyitemr   r   r   register_item   s    
zDictRegistry.register_itemTc             C   s(   || j kr| j |= n|s$td| dS )zRemove item from the registry.z!%s: key not present to unregisterN)r   KeyError)r   r   forcer   r   r   unregister_item   s    

zDictRegistry.unregister_itemc             C   s   t j | jS )zvAll the items that have been registered.

        This cannot be used to modify the contents of the registry.
        )copyr   )r   r   r   r   registered_items    s    zDictRegistry.registered_itemsN)T)
__name__
__module____qualname____doc__r   r   r   r   propertyr   r   r   r   r   r      s   
r   )r   r   r   r   r   r   <module>   s   