U
    k&p[A  ã                   @   s   G d d„ de ƒZdS )c                   @   s8   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )ÚHookManagerz0Manage the set of hooks the application defines.c                 C   s
   i | _ d S )N©Úhooks)Úself© r   ú0/usr/lib/python3/dist-packages/cliapp/hookmgr.pyÚ__init__   s    zHookManager.__init__c                 C   s   || j kr|| j |< dS )zkAdd a new hook to the manager.

        If a hook with that name already exists, nothing happens.

        Nr   )r   ÚnameÚhookr   r   r   Únew   s    
zHookManager.newc                 C   s   | j |  |¡S )zAdd a callback to a named hook.)r   Úadd_callback)r   r   Úcallbackr   r   r   r   #   s    zHookManager.add_callbackc                 C   s   | j |  |¡ dS )z-Remove a specific callback from a named hook.N)r   Úremove_callback)r   r   Zcallback_idr   r   r   r   '   s    zHookManager.remove_callbackc                 O   s   | j | j||ŽS )z7Call callbacks for a named hook, using given arguments.)r   Zcall_callbacks)r   r   ÚargsÚkwargsr   r   r   Úcall+   s    zHookManager.callN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r
   r   r   r   r   r   r   r   r      s   
r   N)Úobjectr   r   r   r   r   Ú<module>   ó    