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
U
G=®dîã@s¶dZddlZddlZddlZddlZddlZddlZddlmZddl    m
Z
ddddd    d
d gZ Gd d    „d    eƒZ d d„Z e dfdd„Ze fdd „Ze fdd„Ze fdd„ZeeefZdS)z/Utilities for extracting common archive formatséN)ÚDistutilsError)Úensure_directoryÚunpack_archiveÚunpack_zipfileÚunpack_tarfileÚdefault_filterÚUnrecognizedFormatÚextraction_driversÚunpack_directoryc@seZdZdZdS)rz#Couldn't recognize the archive typeN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__©rrúND:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/archive_util.pyrscCs|S)z@The default progress/filter callback; returns True for all filesr)ÚsrcÚdstrrrrsc    CsN|ptD]4}z||||ƒWntk
r4YqYqXdSqtd|ƒ‚dS)a¡Unpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat``
 
    `progress_filter` is a function taking two arguments: a source path
    internal to the archive ('/'-separated), and a filesystem path where it
    will be extracted.  The callback must return the desired extract path
    (which may be the same as the one passed in), or else ``None`` to skip
    that file or directory.  The callback can thus be used to report on the
    progress of the extraction, as well as to filter the items extracted or
    alter their extraction paths.
 
    `drivers`, if supplied, must be a non-empty sequence of functions with the
    same signature as this function (minus the `drivers` argument), that raise
    ``UnrecognizedFormat`` if they do not support extracting the designated
    archive type.  The `drivers` are tried in sequence until one is found that
    does not raise an error, or until all are exhausted (in which case
    ``UnrecognizedFormat`` is raised).  If you do not supply a sequence of
    drivers, the module's ``extraction_drivers`` constant will be used, which
    means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that
    order.
    Nz!Not a recognized archive type: %s)r    r)ÚfilenameÚ extract_dirÚprogress_filterZdriversZdriverrrrrs 
ÿc CsÖtj |¡std|ƒ‚|d|fi}t |¡D]¢\}}}||\}}|D],}    ||    dtj ||    ¡f|tj ||    ¡<qH|D]T}
tj ||
¡} |||
| ƒ} | s qzt| ƒtj ||
¡}
t |
| ¡t     |
| ¡qzq.dS)z‡"Unpack" a directory, using the same interface as for archives
 
    Raises ``UnrecognizedFormat`` if `filename` is not a directory
    z%s is not a directoryÚú/N)
ÚosÚpathÚisdirrÚwalkÚjoinrÚshutilÚcopyfileÚcopystat) rrrÚpathsÚbaseÚdirsÚfilesrrÚdÚfÚtargetrrrr
@s$  ÿ * c
Csêt |¡std|fƒ‚t |¡¾}| ¡D]®}|j}| d¡s,d| d¡krPq,tj    j
|f| d¡žŽ}|||ƒ}|sxq,|  d¡rŒt |ƒn4t |ƒ|  |j¡}t|dƒ}| |¡W5QRX|jd?}    |    r,t ||    ¡q,W5QRXdS)zòUnpack zip `filename` to `extract_dir`
 
    Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined
    by ``zipfile.is_zipfile()``).  See ``unpack_archive()`` for an explanation
    of the `progress_filter` argument.
    z%s is not a zip filerú..ÚwbéN)ÚzipfileÚ
is_zipfilerÚZipFileÚinfolistrÚ
startswithÚsplitrrrÚendswithrÚreadÚopenÚwriteÚ external_attrÚchmod)
rrrÚzÚinfoÚnamer&Údatar%Zunix_attributesrrrr[s(
 
 
 
 
c
Csvzt |¡}Wn4tjk
rB}ztd|fƒ|‚W5d}~XYnXt |¡dd„|_|D]ú}|j}| d¡s`d|     d¡kr`t
j j |f|     d¡žŽ}|dk    rð|  ¡s´| ¡rð|j}| ¡rät |j¡}    t  |    |¡}t |¡}| |¡}qœ|dk    r`| ¡s
| ¡r`|||ƒ}
|
r`|
 t
j¡r2|
dd…}
z| ||
¡Wq`tjk
rZYq`Xq`W5QR£dSQRXdS)    zûUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir`
 
    Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined
    by ``tarfile.open()``).  See ``unpack_archive()`` for an explanation
    of the `progress_filter` argument.
    z/%s is not a compressed or uncompressed tar fileNcWsdS)Nr)ÚargsrrrÚ<lambda>óz unpack_tarfile.<locals>.<lambda>rr'éÿÿÿÿT)Útarfiler2ÚTarErrorrÚ
contextlibÚclosingÚchownr8r.r/rrrÚislnkÚissymÚlinknameÚ    posixpathÚdirnameÚnormpathÚ
_getmemberÚisfilerr0ÚsepÚ_extract_memberÚ ExtractError) rrrÚtarobjÚeÚmemberr8Z
prelim_dstÚlinkpathr!Z    final_dstrrrr€sFÿþ
 
ÿÿ  
 
 )rr*r>rrrFr@Údistutils.errorsrÚ pkg_resourcesrÚ__all__rrrr
rrr    rrrrÚ<module>s2  þþ
$  % /