3
6ßL]%  ã               @   s8   d dl mZ d dlmZ G dd„ deƒZejeeƒ dS )é    )ÚAdapterBase)ÚActionc                   s@   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Z‡ fd
d„Z‡  Z	S )ÚActionAdapterz'This is the adapter for PyFace actions.c             C   s   | j jS )z,Get the enabled state of the proxied object.)ÚproxiedÚenabled)Úself© r   úQ/tmp/pip-install-5sebvq2j/apptools/apptools/permissions/adapters/pyface_action.pyÚget_enabled   s    zActionAdapter.get_enabledc             C   s   || j _dS )z,Set the enabled state of the proxied object.N)r   r   )r   Úvaluer   r   r	   Úset_enabled   s    zActionAdapter.set_enabledc             C   s   | j jS )z,Get the visible state of the proxied object.)r   Úvisible)r   r   r   r	   Úget_visible"   s    zActionAdapter.get_visiblec             C   s   || j _dS )z,Set the visible state of the proxied object.N)r   r   )r   r   r   r   r	   Úset_visible'   s    zActionAdapter.set_visiblec                s>   |dkr| j |ƒ n&|dkr(| j|ƒ ntt| ƒj||ƒ dS )ztReimplemented to intercept the setting of the enabled and visible
        attributes of the proxied action.
        r   r   N)Zupdate_enabledZupdate_visibleÚsuperr   Úsetattr)r   Únamer   )Ú	__class__r   r	   r   ,   s
    zActionAdapter.setattr)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r   Ú__classcell__r   r   )r   r	   r      s   r   N)Z!apptools.permissions.adapter_baser   Zpyface.action.apir   r   Zregister_adapterr   r   r   r	   Ú<module>   s   #