o
    “^©i<  ã                   @   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 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)Úpreprocess_pathsÚ
FoundationÚCoreServicesé   é   é   é   c                   @   s   e Zd Zded fgZdS )ÚFSRefÚhiddenéP   N)Ú__name__Ú
__module__Ú__qualname__r   Ú_fields_© r   r   úP/home/ubuntu/hpml_nyu/venv/lib/python3.10/site-packages/send2trash/mac/legacy.pyr       s    r   c                 C   s   | rt | ƒ d¡}t|ƒ‚d S )Núutf-8)ÚGetMacOSStatusCommentStringÚdecodeÚOSError)Ú	op_resultÚmsgr   r   r   Úcheck_op_result$   s   þr   c                 C   sd   t | ƒ} dd„ | D ƒ} | D ]"}tƒ }t}t||t|ƒd ƒ}t|ƒ t}tt|ƒd |ƒ}t|ƒ qd S )Nc                 S   s$   g | ]}t |tƒs| d ¡n|‘qS )r   )Ú
isinstanceÚbytesÚ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   Úsend2trash.utilr	   ÚLoadLibraryr
   r   r   Úrestyper'   r)   ÚkFSPathMakeRefDefaultOptionsr&   r(   ÚkFSFileOperationOverwriteÚ*kFSFileOperationSkipSourcePermissionErrorsÚ&kFSFileOperationDoNotMoveAcrossVolumesÚkFSFileOperationSkipPreflightr   r   r-   r   r   r   r   Ú<module>   s(   