3
6ßL]	  ã               @   sp   d dl mZmZmZmZ d dlmZmZmZ d dl	m
Z
 d dlmZ G dd„ deƒZG dd„ deƒZd	d
„ ZdS )é    )Ú	HasTraitsÚInstanceÚListÚUnicode)ÚItemÚTableEditorÚView)ÚOKCancelButtons)ÚObjectColumnc               @   s   e Zd ZdZeZeZdS )Ú_UserzThis represents the user model.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚnameÚdescription© r   r   úN/tmp/pip-install-5sebvq2j/apptools/apptools/permissions/default/select_user.pyr      s   r   c               @   s\   e Zd ZdZeeƒZeeƒZe	e
dd�e
dd�gdddd�Zeed	ded
�ddded�ZdS )Ú
_UsersViewz/This represents the view used to select a user.r   )r   r   Ú	selectionTF)ÚcolumnsÚselectedZ
sort_modelZconfigurableÚmodel)Z
show_labelÚeditorzSelect a UserÚreadonlyÚmodal)ÚtitleÚstyleÚkindZbuttonsN)r   r   r   r   r   r   r   r   r   r   r
   Ztable_editorr   r   r	   Ztraits_viewr   r   r   r   r   #   s   

r   c             C   sD   dd„ | D ƒ}t |d�}|jƒ r<|jdk	r<|jj|jjf}nd}|S )z2Return a single user from the given list of users.c             S   s   g | ]\}}t ||d �‘qS ))r   r   )r   )Ú.0r   r   r   r   r   ú
<listcomp>=   s   zselect_user.<locals>.<listcomp>)r   NÚ )r!   r!   )r   Zconfigure_traitsr   r   r   )Zusersr   ÚviewÚuserr   r   r   Úselect_user9   s    
r$   N)Z
traits.apir   r   r   r   Ztraitsui.apir   r   r   Ztraitsui.menur	   Ztraitsui.table_columnr
   r   r   r$   r   r   r   r   Ú<module>   s   