3
<Ad]  ã               @   s\   d dl mZ d dlmZmZmZmZmZ eeƒG dd„ deƒƒZeeƒG dd„ deƒƒZ	dS )é    )ÚIDropHandler)ÚCallableÚ	HasTraitsÚListÚprovidesÚStrc               @   s(   e Zd ZdZeZeZdd„ Zdd„ ZdS )ÚBaseDropHandlerz Basic drop handler
    c             C   s   | j ||ƒS )N)Úon_can_handle)ÚselfÚeventÚtarget© r   úm/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/pyface-6.1.2-py3.6.egg/pyface/drop_handler.pyÚcan_handle_drop   s    zBaseDropHandler.can_handle_dropc             C   s   | j ||ƒS )N)Ú	on_handle)r
   r   r   r   r   r   Úhandle_drop   s    zBaseDropHandler.handle_dropN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   r   r   r   r   r   r   r   r      s
   r   c               @   s,   e Zd ZdZeeƒZeZdd„ Z	dd„ Z
dS )ÚFileDropHandlerz: Class to handle backward compatible file drop events
    c             C   sB   |j ƒ jƒ r>x0|j ƒ jƒ D ] }|jƒ }|jt| jƒƒrdS qW dS )zA Does the drop event contails file data with matching extensions TF)ÚmimeDataZhasUrlsÚurlsÚtoLocalFileÚendswithÚtupleÚ
extensions)r
   r   r   ÚurlÚ	file_pathr   r   r   r   (   s    zFileDropHandler.can_handle_dropc             C   s(   x"|j ƒ jƒ D ]}| j|jƒ ƒ qW dS )z+ Open the file using the supplied callback N)r   r   Ú	open_filer   )r
   r   r   r   r   r   r   r   1   s    zFileDropHandler.handle_dropN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s
   	r   N)
Zpyface.i_drop_handlerr   Z
traits.apir   r   r   r   r   r   r   r   r   r   r   Ú<module>   s
   