B aX @sddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl mZe rre rre rrddZneZd d Zd d Zd dZddZddZddZGdddeZdZdS))absolute_importunicode_literalsN)S_IWUSR)PY2) IS_CPYTHONIS_WIN) ensure_textcCs tt|S)N)rstr)srcr K/opt/alt/python37/lib/python3.7/site-packages/virtualenv/util/path/_sync.pynormsr cCs.|s*tdtt|tt|dS)Nzcreate folder %s)existsloggingdebugrr osmakedirsr )pathr r r ensure_dirsrcCs`||krtd||s"dS|rH|sHtd|t|ntd||dS)Nz%source and destination is the same {}zremove directory %szremove file %s) ValueErrorformatris_dir is_symlinkrr safe_deleteunlink)r destr r r ensure_safe_to_dos   rcCs2t||tdt|||j||ddS)Nz symlink %s)Ztarget_is_directory)rrr_DebugZ symlink_tor)r rr r r symlink)s rcCsHt|||}|rtntj}tdt|||t|t|dS)Nzcopy %s) rrcopytreeshutilcopyrrrr )r rrmethodr r r r!/s  r!c Csx|t|D]n\}}}tj|tj||}tj|sDt|x4|D],}tj||}tj||}t||qJWq WdS)N) rwalkrjoinrelpathisdirrr r!) r rroot_filesZdest_dirnameZsrc_fZdest_fr r r r7s   rcCs$dd}tjtt|d|ddS)NcSs*t|tjs$t|t||ndS)N)raccessW_OKchmodr)funcrexc_infor r r onerrorCs  zsafe_delete..onerrorT) ignore_errorsr0)r rmtreerr )rr0r r r rBsrc@seZdZddZddZdS)rcCs||_||_dS)N)r r)selfr rr r r __init__Nsz_Debug.__init__cCs0d|jrdndtt|jtt|jS)Nz {}{} to {}z directory )rr rrr r)r3r r r __str__Rs z_Debug.__str__N)__name__ __module__ __qualname__r4r6r r r r rMsr)rrr!rrr) __future__rrrrr statrZsixrZvirtualenv.inforrZvirtualenv.util.sixrr r rrrr!rrobjectr__all__r r r r s$