3
7ßL]h  ã               @   sH   d Z ddlmZmZmZ ddlmZ G dd„ deƒZG dd„ deƒZ	dS )	zC The interface for a dialog that prompts for a choice from a list. é    )ÚAnyÚListÚStr)ÚIDialogc               @   s$   e Zd ZdZeeƒZeZeZ	eZ
dS )ÚISingleChoiceDialogzC The interface for a dialog that prompts for a choice from a list. N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚchoicesÚchoicer   Úname_attributeÚmessage© r   r   úA/tmp/pip-install-5sebvq2j/pyface/pyface/i_single_choice_dialog.pyr      s
   r   c               @   s   e Zd ZdZdd„ ZdS )ÚMSingleChoiceDialogz~ The mixin class that contains common code for toolkit specific
    implementations of the IConfirmationDialog interface.
    c                sj   ˆ j }ˆ jdkr"‡ fdd„|D ƒ}dd„ |D ƒ}t|ƒdkrFtdƒ‚n t|ƒtt|ƒƒkrftd| ƒ‚|S )z7 Returns the list of strings to display in the dialog. Ú c                s   g | ]}t |ˆ jƒ‘qS r   )Úgetattrr   )Ú.0Úobj)Úselfr   r   ú
<listcomp>4   s    z7MSingleChoiceDialog._choice_strings.<locals>.<listcomp>c             S   s   g | ]}t |ƒ‘qS r   )Ústr)r   r   r   r   r   r   6   s    r   z.SingleChoiceDialog requires at least 1 choice.z0Dialog choices {} contain repeated string value.)r   r   ÚlenÚ
ValueErrorÚset)r   r   r   )r   r   Ú_choice_strings/   s    

z#MSingleChoiceDialog._choice_stringsN)r   r   r	   r
   r   r   r   r   r   r   *   s   r   N)
r
   Z
traits.apir   r   r   Zpyface.i_dialogr   r   Úobjectr   r   r   r   r   Ú<module>   s   