3
6ßL]Þ  ã               @   s@   d dl mZ d dlmZmZmZ ddlmZ G dd„ deƒZdS )é    )ÚAction)ÚAnyÚCallableÚInstanceé   )ÚICommandStackc               @   s0   e Zd ZdZeZeeƒZe	Z
dd„ Zdd„ ZdS )ÚCommandActionz¬ The CommandAction class is an Action class that wraps undo/redo
    commands.  It is only useful for commands that do not take any arguments or
    return any result.
    c             C   s   | j j| j| jd�ƒ dS )z^ This is reimplemented to push a new command instance onto the
        command stack.
        )ÚdataN)Úcommand_stackÚpushÚcommandr	   )ÚselfÚevent© r   úI/tmp/pip-install-5sebvq2j/apptools/apptools/undo/action/command_action.pyÚperform-   s    zCommandAction.performc             C   s   | j r| j ƒ j}nd}|S )z- This gets the action name from the command. Ú )r   Úname)r   r   r   r   r   Ú_name_default4   s    zCommandAction._name_defaultN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r
   r   r	   r   r   r   r   r   r   r      s   r   N)	Zpyface.action.apir   Z
traits.apir   r   r   Zi_command_stackr   r   r   r   r   r   Ú<module>   s   