관리-도구
편집 파일: _sync.cpython-37.pyc
B ���aX � @ s� d dl mZmZ d dlZd dlZd dlZd dlmZ d dlm Z d dl mZmZ d dl mZ e rrerrerrdd� ZneZd d � Zdd� Zd d� Zdd� Zdd� Zdd� ZG dd� de�ZdZdS )� )�absolute_import�unicode_literalsN)�S_IWUSR)�PY2)� IS_CPYTHON�IS_WIN)�ensure_textc C s t t| ��S )N)r �str)�src� r �K/opt/alt/python37/lib/python3.7/site-packages/virtualenv/util/path/_sync.py�norm s r c C s. | � � s*t�dtt| ��� t�t| �� d S )Nzcreate folder %s)�exists�logging�debugr r �os�makedirsr )�pathr r r � ensure_dir s r c C s` | |krt d�| ���|�� s"d S |�� rH|�� sHt�d|� t|� nt�d|� |�� d S )Nz%source and destination is the same {}zremove directory %szremove file %s) � ValueError�formatr �is_dir� is_symlinkr r �safe_delete�unlink)r �destr r r �ensure_safe_to_do s r c C s2 t | |� t�dt| |�� |j| | �� d� d S )Nz symlink %s)Ztarget_is_directory)r r r �_DebugZ symlink_tor )r r r r r �symlink) s r c C sH t | |� | �� }|rtntj}t�dt| |�� |t| �t|�� d S )Nzcopy %s) r r �copytree�shutil�copyr r r r )r r r �methodr r r r! / s r! c C s� x|t �| �D ]n\}}}t j�|t j�|| ��}t j�|�sDt �|� x4|D ],}t j�||�}t j�||�}t�||� qJW qW d S )N) r �walkr �join�relpath�isdirr r r! ) r r �root�_�filesZdest_dir�nameZsrc_fZdest_fr r r r 7 s r c C s$ dd� }t jtt| ��d|d� d S )Nc S s* t �|t j�s$t �|t� | |� n� d S )N)r �access�W_OK�chmodr )�funcr �exc_infor r r �onerrorC s zsafe_delete.<locals>.onerrorT)� ignore_errorsr0 )r �rmtreer r )r r0 r r r r B s r c @ s e Zd Zdd� Zdd� ZdS )r c C s || _ || _d S )N)r r )�selfr r r r r �__init__N s z_Debug.__init__c C s0 d� | j�� rdndtt| j��tt| j���S )Nz {}{} to {}z directory � )r r r r r r )r3 r r r �__str__R s z_Debug.__str__N)�__name__� __module__�__qualname__r4 r6 r r r r r M s r )r r r! r r r )� __future__r r r r r �statr Zsixr Zvirtualenv.infor r Zvirtualenv.util.sixr r r r r r r! r r �objectr �__all__r r r r �<module> s$