zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
U
G=®dbã@spdZddlZddlZddlmZmZddlmZiaddd„Z    dd    d
„Z
dd d „Z d d„Z ddd„Z dd„ZdS)zWdistutils.dir_util
 
Utility functions for manipulating directories and directory trees.éN)ÚDistutilsFileErrorÚDistutilsInternalError)Úlogéÿéc Csft|tƒstd|fƒ‚tj |¡}g}tj |¡s<|dkr@|St tj     |¡¡rV|Stj 
|¡\}}|g}|rž|ržtj |¡sžtj 
|¡\}}|  d|¡ql|D]¾}tj  ||¡}tj     |¡}    t |    ¡rÌq¢|dkràt  d|¡|sXzt ||¡WnVtk
rL}
z6|
jtjkr&tj |¡s<td||
jdfƒ‚W5d}
~
XYnX| |¡dt|    <q¢|S)    aì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.
    z(mkpath: 'name' must be a string (got %r)Úrrz creating %szcould not create '%s': %séÿÿÿÿN)Ú
isinstanceÚstrrÚosÚpathÚnormpathÚisdirÚ _path_createdÚgetÚabspathÚsplitÚinsertÚjoinrÚinfoÚmkdirÚOSErrorÚerrnoÚEEXISTrÚargsÚappend) ÚnameÚmodeÚverboseÚdry_runÚ created_dirsÚheadÚtailÚtailsÚdÚabs_headÚexc©r'úUD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/_distutils/dir_util.pyÚmkpathsB
ÿ  
 ÿ
 
r)c    CsNtƒ}|D] }| tj |tj |¡¡¡q
t|ƒD]}t||||dq4dS)a­Create all the empty directories under 'base_dir' needed to put 'files'
    there.
 
    'base_dir' is just the 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()'.
    ©rrN)ÚsetÚaddr r rÚdirnameÚsortedr))Úbase_dirÚfilesrrrÚneed_dirÚfileÚdirr'r'r(Ú create_treePs
 r4c Cs^ddlm}|s(tj |¡s(td|ƒ‚zt |¡}    Wn>tk
rt}
z |rRg}    ntd||
jfƒ‚W5d}
~
XYnX|s†t    ||dg} |    D]Ê} tj 
|| ¡} tj 
|| ¡}|   d¡rºqŽ|r
tj  | ¡r
t  | ¡}|dkrît d    ||¡|sþt ||¡|  |¡qŽtj | ¡r8|  t| |||||||d
¡qŽ|| ||||||d
|  |¡qŽ| S) aCopy 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'.
    r)Ú    copy_filez&cannot copy tree '%s': not a directoryzerror listing files in '%s': %sN)rz.nfsrzlinking %s -> %sr*)Údistutils.file_utilr5r r rrÚlistdirrÚstrerrorr)rÚ
startswithÚislinkÚreadlinkrrÚsymlinkrÚextendÚ    copy_tree)ÚsrcÚdstÚ preserve_modeÚpreserve_timesÚpreserve_symlinksÚupdaterrr5ÚnamesÚeÚoutputsÚnÚsrc_nameÚdst_nameÚ    link_destr'r'r(r>cs\ ÿ ÿ 
 
  þÿþ r>cCsft |¡D]F}tj ||¡}tj |¡r@tj |¡s@t||ƒq
| tj|f¡q
| tj    |f¡dS)zHelper for remove_tree().N)
r r7r rrr:Ú_build_cmdtuplerÚremoveÚrmdir)r Ú    cmdtuplesÚfÚreal_fr'r'r(rL¨s  rLc Csœ|dkrt d|¡|rdSg}t||ƒ|D]h}z2|d|dƒtj |d¡}|tkrbt|=Wq.tk
r”}zt d||¡W5d}~XYq.Xq.dS)zRecursively remove an entire directory tree.
 
    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    rz'removing '%s' (and everything under it)Nrzerror removing %s: %s)    rrrLr r rrrÚwarn)Ú    directoryrrrOÚcmdrr&r'r'r(Ú remove_tree²s 
 
rUcCs6tj |¡\}}|dd…tjkr2||dd…}|S)z†Take the full path 'path', and make it a relative path.
 
    This is useful to make 'path' the second argument to os.path.join().
    rrN)r r Ú
splitdriveÚsep)r Údriver'r'r(Úensure_relativeÊsrY)rrr)rrr)rrrrrr)rr)Ú__doc__r rÚdistutils.errorsrrÚ    distutilsrrr)r4r>rLrUrYr'r'r'r(Ú<module>s  
?
ÿ
E