a
    ¦ˆce  ã                   @   sL   d Z ddlmZ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 )	úC The interface for a dialog that prompts for a choice from a list. é    )ÚAnyÚ	HasTraitsÚListÚStr)ÚIDialogc                   @   s*   e Zd ZdZeeƒZeƒ Zeƒ Z	eƒ Z
dS )ÚISingleChoiceDialogr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚchoicesÚchoicer   Úname_attributeÚmessage© r   r   ú`/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/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>0   ó    z7MSingleChoiceDialog._choice_strings.<locals>.<listcomp>c                 S   s   g | ]}t |ƒ‘qS r   )Ústrr   r   r   r   r   2   r   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   r   Zpyface.i_dialogr   r   r   r   r   r   r   Ú<module>   s   