B
    ¢èåSF  ã               @   s   G d d„ de ƒZdS )c               @   sF   e Zd Zdd„ Zdd„ Zdd„ Zddd	„Zd
d„ Zdd„ Zdd„ Z	dS )ÚPrefsc             C   s   i | _ i | _d S )N)ÚprefsÚ	callbacks)Úself© r   ú.lib/python3.7/site-packages/rope/base/prefs.pyÚ__init__   s    zPrefs.__init__c             C   s(   || j kr| j | |ƒ n
|| j|< dS )z-Set the value of `key` preference to `value`.N)r   r   )r   ÚkeyÚvaluer   r   r   Úset   s    
z	Prefs.setc             C   s(   || j krg | j |< | j |  |¡ dS )zqAdd an entry to a list preference

        Add `value` to the list of entries for the `key` preference.

        N)r   Úappend)r   r   r	   r   r   r   Úadd   s    

z	Prefs.addNc             C   s   | j  ||¡S )z#Get the value of the key preference)r   Úget)r   r   Údefaultr   r   r   r      s    z	Prefs.getc             C   s   || j |< dS )zšAdd `key` preference with `callback` function

        Whenever `key` is set the callback is called with the
        given `value` as parameter.

        N)r   )r   r   Úcallbackr   r   r   Úadd_callback   s    zPrefs.add_callbackc             C   s   |   ||¡ d S )N)r
   )r   r   r	   r   r   r   Ú__setitem__%   s    zPrefs.__setitem__c             C   s
   |   |¡S )N)r   )r   r   r   r   r   Ú__getitem__(   s    zPrefs.__getitem__)N)
Ú__name__Ú
__module__Ú__qualname__r   r
   r   r   r   r   r   r   r   r   r   r      s   

	r   N)Úobjectr   r   r   r   r   Ú<module>   s    