zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
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
U
W±dhã@s|ddlZddlZddlZddlmZddlmZmZddl    m
Z
ddl m Z e  e¡Zdd„e
Dƒdh™ZGd    d
„d
ƒZdS) éN)Úlog)ÚTreeÚ normalize_toc)Ú ALL_SUFFIXES)Úget_path_to_eggccs|]}d|VqdS)Ú*N©)Ú.0ÚxrrúZd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PyInstaller/building/toc_conversion.pyÚ    <genexpr>sr zEGG-INFOc@sLeZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Ze    d d „ƒZ
dd„Z dS)ÚDependencyProcessorzš
    Class to convert final module dependency graph into TOC data structures.
    TOC data structures are suitable for creating the final executable.
    cCs|tƒ|_tƒ|_tƒ|_tƒ|_|j|jdD]H}|j}||krd|j |     |¡¡|j | 
|¡¡|j |  |¡¡q.dS)N)Ústart) ÚsetÚ    _binariesÚ_datasÚ_distributionsÚ-_DependencyProcessor__seen_distribution_pathsZ
iter_graphZ_top_script_nodeÚ
identifierÚupdateZbinariesZdatasÚ_get_distribution_for_node)ÚselfÚgraphZadditional_filesÚnodeÚnamerrr Ú__init__%szDependencyProcessor.__init__cCsz|j}|sgSt|ƒ}|r$||jkr(gS|j |¡tt |¡ƒ}t|ƒdksRt‚|d}t     
|j ¡d|  d¡dœ|_ |S)zw
        Get the distribution a module belongs to.
 
        Bug: This currently only handles packages in eggs.
        érTúzip-safe)ÚzippedÚeggr)ÚfilenamerrÚaddÚlistÚ pkg_resourcesÚfind_distributionsÚlenÚAssertionErrorÚzipfileÚ
is_zipfileÚlocationÚ has_metadataÚ_pyinstaller_info)rrÚmodpathZdistpathÚdistsÚdistrrr r5s 
ýz.DependencyProcessor._get_distribution_for_nodecCsdd„|jDƒ}t|ƒS)NcSsg|]\}}||df‘qS)ÚBINARYr©r    r
Úyrrr Ú
<listcomp>dsz9DependencyProcessor.make_binaries_toc.<locals>.<listcomp>)rr)rÚtocrrr Úmake_binaries_toccsz%DependencyProcessor.make_binaries_toccCsZdd„|jDƒ}|jD]:}|jdr|jds|jdst|jtd}| |¡qt|ƒS)NcSsg|]\}}||df‘qS)ZDATArr0rrr r2hsz6DependencyProcessor.make_datas_toc.<locals>.<listcomp>rrr©Zexcludes)rrr+rr)ÚPY_IGNORE_EXTENSIONSÚextendr©rr3r.Útreerrr Úmake_datas_tocgs
ÿÿþ z"DependencyProcessor.make_datas_toccCsLg}|jD]8}|jdr
|jds
| dtj |j¡|jdf¡q
t|ƒS)Nrrzeggs/ZZIPFILE)rr+ÚappendÚosÚpathÚbasenamer)r)rr3r.rrr Úmake_zipfiles_tocss
 
"z%DependencyProcessor.make_zipfiles_tocc
Csšddlm}tj |dtj |¡¡}zt |¡Wn8tk
rl}zddl}|j|j    kr\‚W5d}~XYnXt
  |¡}|  |¡W5QRXt |tdS)Nr)ÚCONFÚworkpathr5)ZPyInstaller.configr@r<r=Újoinr>ÚmakedirsÚOSErrorÚerrnoÚEEXISTr'ÚZipFileÚ
extractallrr6)Z zipfilenamer@rAÚerEZzfhrrr Z__collect_data_files_from_zip|s   z1DependencyProcessor.__collect_data_files_from_zipcCsrg}t d¡|jD]T}|jdr|jdrD| |j¡}| |¡q|jdrt|jtd}| |¡qqt    |ƒS)NzLooking for egg data files...rrrr5)
ÚloggerÚdebugrr+Ú1_DependencyProcessor__collect_data_files_from_zipr)r7rr6rr8rrr Úmake_zipped_data_tocŒs
 
 
 
 
 z(DependencyProcessor.make_zipped_data_tocN) Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrr4r:r?Ú staticmethodrLrMrrrr r  s.     
r )r<r'r#Z PyInstallerrÚloggingZPyInstaller.building.datastructrrZPyInstaller.compatrZPyInstaller.depend.utilsrÚ    getLoggerrNrJr6r rrrr Ú<module> s   
 ý