B
    '‹dm  ã               @   sÀ   d dl mZ d dlmZmZmZmZmZ d dlm	Z	 d dl
mZ d dlmZ e e	dƒ¡Ze e	dƒ¡ZejZee_ejZejZd ZdZd ZdZd	Zd
ZdZG dd„ deƒZdd„ Zdd„ ZdS )é    )Úunicode_literals)ÚcdllÚbyrefÚ	StructureÚc_charÚc_char_p)Úfind_library)Úbinary_type)Úpreprocess_pathsÚ
FoundationÚCoreServicesé   é   é   é   c               @   s   e Zd Zded fgZdS )ÚFSRefZhiddenéP   N)Ú__name__Ú
__module__Ú__qualname__r   Z_fields_© r   r   úb/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/send2trash/mac/legacy.pyr   !   s   r   c             C   s   | rt | ƒ d¡}t|ƒ‚d S )Nzutf-8)ÚGetMacOSStatusCommentStringÚdecodeÚOSError)Ú	op_resultÚmsgr   r   r   Úcheck_op_result%   s    r   c             C   sh   t | ƒ} dd„ | D ƒ} xL| D ]D}tƒ }t}t||t|ƒd ƒ}t|ƒ t}tt|ƒd |ƒ}t|ƒ qW d S )Nc             S   s$   g | ]}t |tƒs| d ¡n|‘qS )zutf-8)Ú
isinstancer	   Úencode)Ú.0Úpathr   r   r   ú
<listcomp>-   s    zsend2trash.<locals>.<listcomp>)r
   r   Ú$kFSPathMakeRefDoNotFollowLeafSymlinkÚFSPathMakeRefWithOptionsr   r   ÚkFSFileOperationDefaultOptionsÚFSMoveObjectToTrashSync)Úpathsr!   ÚfpÚoptsr   r   r   r   Ú
send2trash+   s    
r*   N)Ú
__future__r   Úctypesr   r   r   r   r   Úctypes.utilr   Zsend2trash.compatr	   Zsend2trash.utilr
   ZLoadLibraryr   r   r   Úrestyper$   r&   ZkFSPathMakeRefDefaultOptionsr#   r%   ZkFSFileOperationOverwriteZ*kFSFileOperationSkipSourcePermissionErrorsZ&kFSFileOperationDoNotMoveAcrossVolumesZkFSFileOperationSkipPreflightr   r   r*   r   r   r   r   Ú<module>   s(   