Your IP : 3.142.172.250


Current Path : /opt/alt/python33/lib64/python3.3/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/distutils/__pycache__/dir_util.cpython-33.pyc

�
��f�c@s�dZddlZddlZddlmZmZddlmZiaddddd�Z	dddd	d
�Z
dddddddd�Zd
d�Zdddd�Z
dd�ZdS(uWdistutils.dir_util

Utility functions for manipulating directories and directory trees.iN(uDistutilsFileErroruDistutilsInternalError(ulogi�icCs�t|t�s%td|f��ntjj|�}g}tjj|�s[|dkr_|Stjtjj	|��r~|Stjj
|�\}}|g}xK|r�|r�tjj|�r�tjj
|�\}}|jd|�q�Wx	|D]}tjj||�}tjj	|�}	tj|	�r6q�n|dkrUt
jd|�n|s�ytj||�Wnitk
r�}
zI|
jtjko�tjj|�s�td||
jdf��nWYdd}
~
XnX|j|�ndt|	<q�W|S(	u�Create a directory and any missing ancestor directories.

    If the directory already exists (or if 'name' is the empty string, which
    means the current directory, which of course exists), then do nothing.
    Raise DistutilsFileError if unable to create some directory along the way
    (eg. some sub-path exists, but is a file rather than a directory).
    If 'verbose' is true, print a one-line summary of each mkdir to stdout.
    Return the list of directories actually created.
    u(mkpath: 'name' must be a string (got %r)uiiucreating %sucould not create '%s': %sNi����(u
isinstanceustruDistutilsInternalErroruosupathunormpathuisdiru
_path_createdugetuabspathusplituinsertujoinuloguinfoumkdiruOSErroruerrnouEEXISTuDistutilsFileErroruargsuappend(unameumodeuverboseudry_runucreated_dirsuheadutailutailsuduabs_headuexc((u7/opt/alt/python33/lib64/python3.3/distutils/dir_util.pyumkpaths>	"
$0umkpathcCsvt�}x6|D].}|jtjj|tjj|���qWx-t|�D]}t||d|d|�qOWdS(u�Create all the empty directories under 'base_dir' needed to put 'files'
    there.

    'base_dir' is just the a name of a directory which doesn't necessarily
    exist yet; 'files' is a list of filenames to be interpreted relative to
    'base_dir'.  'base_dir' + the directory portion of every file in 'files'
    will be created if it doesn't already exist.  'mode', 'verbose' and
    'dry_run' flags are as for 'mkpath()'.
    uverboseudry_runN(usetuadduosupathujoinudirnameusortedumkpath(ubase_dirufilesumodeuverboseudry_rununeed_dirufileudir((u7/opt/alt/python33/lib64/python3.3/distutils/dir_util.pyucreate_treePs
	
,ucreate_treecCsddlm}|r=tjj|�r=td|��nytj|�}	WnYtjk
r�}
z6|
\}}|r�g}	ntd||f��WYdd}
~
XnX|s�t|d|�ng}
x1|	D])}tjj	||�}tjj	||�}|j
d�rq�n|r�tjj|�r�tj|�}|dkr`t
jd	||�n|sytj||�n|
j|�q�tjj|�r�|
jt||||||d|d
|��q�||||||d|d
|�|
j|�q�W|
S(uCopy an entire directory tree 'src' to a new location 'dst'.

    Both 'src' and 'dst' must be directory names.  If 'src' is not a
    directory, raise DistutilsFileError.  If 'dst' does not exist, it is
    created with 'mkpath()'.  The end result of the copy is that every
    file in 'src' is copied to 'dst', and directories under 'src' are
    recursively copied to 'dst'.  Return the list of files that were
    copied or might have been copied, using their output name.  The
    return value is unaffected by 'update' or 'dry_run': it is simply
    the list of all files under 'src', with the names changed to be
    under 'dst'.

    'preserve_mode' and 'preserve_times' are the same as for
    'copy_file'; note that they only apply to regular files, not to
    directories.  If 'preserve_symlinks' is true, symlinks will be
    copied as symlinks (on platforms that support them!); otherwise
    (the default), the destination of the symlink will be copied.
    'update' and 'verbose' are the same as for 'copy_file'.
    i(u	copy_fileu&cannot copy tree '%s': not a directoryuerror listing files in '%s': %sNuverboseu.nfsiulinking %s -> %sudry_run(udistutils.file_utilu	copy_fileuosupathuisdiruDistutilsFileErrorulistdiruerrorumkpathujoinu
startswithuislinkureadlinkuloguinfousymlinkuappenduextendu	copy_tree(usrcudstu
preserve_modeupreserve_timesupreserve_symlinksuupdateuverboseudry_runu	copy_fileunamesueuerrnouerrstruoutputsunusrc_nameudst_nameu	link_dest((u7/opt/alt/python33/lib64/python3.3/distutils/dir_util.pyu	copy_treecsJ	&
u	copy_treecCs�xwtj|�D]f}tjj||�}tjj|�r`tjj|�r`t||�q|jtj|f�qW|jtj	|f�dS(uHelper for remove_tree().N(
uosulistdirupathujoinuisdiruislinku_build_cmdtupleuappenduremoveurmdir(upathu	cmdtuplesufureal_f((u7/opt/alt/python33/lib64/python3.3/distutils/dir_util.pyu_build_cmdtuple�s%u_build_cmdtuplecCs�|dkrtjd|�n|r)dSg}t||�x�|D]�}yB|d|d�tjj|d�}|tkr�t|=nWqCttfk
r�}ztj	d||�WYdd}~XqCXqCWdS(u�Recursively remove an entire directory tree.

    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    iu'removing '%s' (and everything under it)Niuerror removing %s: %s(
uloguinfou_build_cmdtupleuosupathuabspathu
_path_createduIOErroruOSErroruwarn(u	directoryuverboseudry_runu	cmdtuplesucmduabspathuexc((u7/opt/alt/python33/lib64/python3.3/distutils/dir_util.pyuremove_tree�s

uremove_treecCsLtjj|�\}}|dd�tjkrH||dd�}n|S(u�Take the full path 'path', and make it a relative path.

    This is useful to make 'path' the second argument to os.path.join().
    iiN(uosupathu
splitdriveusep(upathudrive((u7/opt/alt/python33/lib64/python3.3/distutils/dir_util.pyuensure_relative�suensure_relative(u__doc__uosuerrnoudistutils.errorsuDistutilsFileErroruDistutilsInternalErroru	distutilsulogu
_path_createdumkpathucreate_treeu	copy_treeu_build_cmdtupleuremove_treeuensure_relative(((u7/opt/alt/python33/lib64/python3.3/distutils/dir_util.pyu<module>s?E


?>