zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
U
X±d®Bã@sòddlZddlZddlZddlZddlZddlZddlmZddlm    Z    m
Z
m Z ddl m Z ddl mZddl mZddlmZe e¡ZGdd    „d    ƒZd
d „Zd d „Zdd„Ze jdd„ƒZdd„Zdd„Zdd„Zdaddd„Z ddd„Z!dS)éN)Ú_resolveCtypesImports)Úcollect_submodulesÚcollect_system_data_filesÚget_hook_config)Úisolated)Úlog)Úcompat)ÚfindSystemLibraryc@s&eZdZddd„Zdd„Zdd„ZdS)    Ú GiModuleInfoNc
CsÜ||_||_d|_g|_d|_g|_|dk    rJt|ddƒ}|rJ| ||¡|_t     d||j¡t
j dd„ƒ}z4|||jƒ}|d|_|d|_|d    |_d
|_Wn:t k
rÖ}zt     d ||j|¡d|_W5d}~XYnXdS) NFÚgizmodule-versionsz"Gathering GI module info for %s %scSs˜ddl}| dd¡ddlm}|j ¡}| |||jj¡|     |¡}|r^dd„| 
d¡Dƒng}|  |¡}t |dƒr‚|  |¡}n
| |¡}|||d    œS)
NrÚ GIRepositoryú2.0)r cSsg|] }| ¡‘qS©)Ústrip)Ú.0ÚlibrrúQd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PyInstaller/utils/hooks/gi.pyÚ
<listcomp>9szCGiModuleInfo.__init__.<locals>._get_module_info.<locals>.<listcomp>ú,Úget_immediate_dependencies)Ú
sharedlibsÚtypelibÚ dependencies)r Úrequire_versionÚ gi.repositoryr Z
RepositoryZ get_defaultÚrequireZRepositoryLoadFlagsZIREPOSITORY_LOAD_FLAG_LAZYZget_shared_libraryÚsplitZget_typelib_pathÚhasattrrZget_dependencies)ÚmoduleÚversionr r ÚreporrrrrrÚ_get_module_info-s  
 
 
 
 
ýz/GiModuleInfo.__init__.<locals>._get_module_inforrrTz#Failed to query GI module %s %s: %s) ÚnamerÚ    availablerrrrÚgetÚloggerÚdebugrÚdecorateÚ    Exception)ÚselfrrZhook_apiZmodule_versionsr!ÚinfoÚerrrÚ__init__s, 
 
 
 
 
zGiModuleInfo.__init__cCs€|js td|j›d|j›dƒ‚|js*dS|jD](}t|ƒ}|r0tj tj     |¡¡Sq0td|j›d|j›d|j›dƒ‚dS)au
        Return the path to shared library used by the module. If no libraries are associated with the typelib, None is
        returned. If multiple library names are associated with the typelib, the path to the first resolved shared
        library is returned. Raises exception if module is unavailable or none of the shared libraries could be
        resolved.
        úModule ú ú is unavailable!Nz(Could not resolve any shared library of z: ú!)
r#Ú
ValueErrorr"rrr    ÚosÚpathÚnormpathÚdirname)r)rr3rrrÚ
get_libdirVs
zGiModuleInfo.get_libdirc
sîg}g}g}t dˆjˆj¡ˆjs>tdˆj›dˆj›dƒ‚tˆjƒ}|D],}t d|d|d¡| |ddf¡qLt    ˆj
ƒ}|r¢t d    |d¡| |¡|t d
‡fd d „ƒ7}ˆj D]$}|  d d¡\}}    |d|›g7}q¾|||fS)zk
        Return a tuple of (binaries, datas, hiddenimports) to be used by PyGObject related hooks.
        z Collecting module data for %s %sr-r.r/z"Collecting shared library %s at %sréÚ.zCollecting gir typelib at %sz gi.overridescs| dˆj¡S)Nr8)Úendswithr")r"©r)rrÚ<lambda>…óz3GiModuleInfo.collect_typelib_data.<locals>.<lambda>ú-zgi.repository.)r%r&r"rr#r1rrÚappendÚgir_library_path_fixrrrÚrsplit)
r)ZdatasZbinariesZ hiddenimportsZ resolved_libsZ resolved_libZ typelib_entryÚdepZ
dep_moduleÚ_rr:rÚcollect_typelib_datais&
 
 
 
z!GiModuleInfo.collect_typelib_data)N)Ú__name__Ú
__module__Ú __qualname__r,r6rCrrrrr
s
9r
cCst||ƒ}| ¡S©N)r
r6©rrZ module_inforrrÚ get_gi_libdirs
rIcCst||ƒ}| ¡S)a*
    Return a tuple of (binaries, datas, hiddenimports) to be used by PyGObject related hooks. Searches for and adds
    dependencies recursively.
 
    :param module: GI module name, as passed to 'gi.require_version()'
    :param version: GI module version, as passed to 'gi.require_version()'
    )r
rCrHrrrÚget_gi_typelibs–s
rJc    Csddl}ddlm}tj |¡}tjrütj tj    |g¡}|dkrft
  d¡tj tj  |ddd¡¡}tj  |dd¡}tj  |¡}tj |¡dd}tj  ||¡}tj |¡sÀt
 d    |¡dStj |¡sÜt
 d
|¡dSt|d d d }| ¡}    W5QRXttj  |d|¡dd d }|    D]„}
d|
kr˜t d|
¡} t d| d¡} t| ƒD](\} }d|krRdtj  |¡| | <qRd  | dd…¡d  | ¡}
| |
¡q W5QRX| dtj  |d|¡dtj  |d|¡f¡}| ¡tj  |d|¡dfS|dfSdS)Nr)ÚCONFú/z+virtualenv detected? fixing the gir path...z..Úsharezgir-1.0z.girz_Unable to find gir directory: %s.
Try installing your platform's gobject-introspection package.zZUnable to find gir file: %s.
Try installing your platform's gobject-introspection package.Úrzutf-8)ÚencodingZworkpathÚwzshared-libraryz(=)z(["|,])érz @loader_path/Úz g-ir-compilerz-oZ gi_typelibs)Ú
subprocessZPyInstaller.configrKr2r3ÚabspathrZ    is_darwinÚ commonprefixÚ base_prefixr%r&ÚjoinÚbasenameÚsplitextÚexistsÚerrorÚopenÚ    readlinesÚrerÚ    enumerateÚwriteÚPopenÚwait)r3rSrKZ common_pathZgir_pathZ typelib_nameZgir_nameZgir_fileÚfÚlinesÚlinerÚfilesÚcountÚitemÚcommandrrrr?¢sZ  
  þ ÿ
 
þr?cCs(ddl}| dd¡ddlm}| ¡S©NrÚGLibr )rk)r rrrkZget_system_data_dirs©r rkrrrÚget_glib_system_data_dirsãs  rmcCs.tjrtj tddƒd¡gStjdd„ƒ}|S)z=
    Try to return the sysconf directories (e.g., /etc).
    rkr ÚetccSs(ddl}| dd¡ddlm}| ¡Srj)r rrrkZget_system_config_dirsrlrrrÚ    data_dirsôs  z(get_glib_sysconf_dirs.<locals>.data_dirs)rZis_winr2r3rWrIrÚcall)rorrrÚget_glib_sysconf_dirsës
 
rqcGsXtƒ}|dkrgStjjd|žŽ}g}|D](}tjj|f|žŽ}|t||dd7}q*|S)zK
    Path is relative to the system data directory (e.g., /usr/share).
    NrMF©ÚdestdirZinclude_py_files)rM)rmr2r3rWr)r3Zglib_data_dirsrsÚ    collectedÚdata_dirÚprrrÚcollect_glib_share_filesþsrwcGsXtƒ}|dkrgStjjd|žŽ}g}|D](}tjj|f|žŽ}|t||dd7}q*|S)zG
    Path is relative to the system config directory (e.g., /etc).
    NrnFrr)rn)rqr2r3rWr)r3Zglib_config_dirsrsrtZ
config_dirrvrrrÚcollect_glib_etc_filessrxcs~tdkrB|dk    r:g}|D]}|ttj d|¡ƒ7}q|antdƒatj|dtj|dg‰tˆdƒ‰‡‡fdd„tDƒS)za
    Return a list of translations in the system locale directory whose names equal prog.mo.
    NÚlocalez.moz.porcs*g|]"\}}|ˆ d…ˆkr||f‘qSrGr)rÚsrcÚdst©ÚnamelenÚnamesrrr8sz-collect_glib_translations.<locals>.<listcomp>)Ú_glib_translationsrwr2r3rWÚsepÚlen)ÚprogZ    lang_listZtransÚlangrr|rÚcollect_glib_translations's r„FcCst d¡}t |¡}g}g}|D]N}|\}}}    t |¡}t |¡}|j|krX| |¡q |jdkrdq | |¡q |sx|St d¡}
|
s”t     d¡|S|d} d} d} |  
¡rÆ|   ¡} t   |  ¡¡ ¡} | ¡rØt |¡|jdd|D]}t ||¡qèt d    t|ƒ¡zB|
t|ƒd
t|ƒg}tj|tjtjtjddd }t d |j¡Wn6tk
r‚t     d |j¡tj    d dd|YSX| dk    rÀt   |  ¡¡ ¡}|| krÀtj| | j | j!fd| t|| jƒt| ƒdf¡|r|D]$}| t||jƒt|ƒdf¡qè|S)aM
    Compile collected GLib schema files. Extracts the list of GLib schema files from the given input datas TOC, copies
    them to temporary working directory, and compiles them. The resulting `gschemas.compiled` file is added to the
    output TOC, replacing any existing entry with that name. If `collect_source_files` flag is set, the source XML
    schema files are also (re)added to the output TOC; by default, they are not. This function is no-op (returns the
    original TOC) if no GLib schemas are found in TOC or if `glib-compile-schemas` executable is not found in `PATH`.
    zshare/glib-2.0/schemas>úgschemas.compiledú gschema.dtdzglib-compile-schemasz\GLib schema compiler (glib-compile-schemas) not found! Skipping GLib schema recompilation...r…NT)Úexist_okz.Compiling collected GLib schema files in %r...z --targetdir)ÚstdinÚstdoutÚstderrÚcheckÚtextz*Extra output from glib-compile-schemas:
%szBFailed to recompile GLib schemas! Returning collected files as-is!)Úexc_info)ÚnsZDATA)"ÚpathlibÚPurePathÚPathÚparentr>r"ÚshutilÚwhichr%ÚwarningÚis_fileÚstatÚhashlibÚsha1Ú
read_bytesÚdigestrZÚrmtreeÚmkdirÚcopyr*ÚstrrSÚrunÚDEVNULLÚPIPEÚSTDOUTr&r‰r(r2ÚutimeÚ st_atime_nsÚ st_mtime_ns)Z    datas_tocZworkdirZcollect_source_filesZSCHEMA_DEST_DIRZ schema_filesZ
output_tocÚ    toc_entryZ    dest_nameÚsrc_nameÚtypecodeZschema_compiler_exeZ compiled_fileZold_compiled_file_hashZold_compiled_file_statZ schema_fileÚcmd_argsrvZnew_compiled_file_hashrrrÚcompile_glib_schema_files=sp
 
 
 
 
 
 
    
 
 
 
 ú
 
 
"r«)N)F)"r2rr“rSr˜r^ZPyInstaller.depend.utilsrZPyInstaller.utils.hooksrrrZ PyInstallerrrÚloggingrZPyInstaller.depend.bindependr    Ú    getLoggerrDr%r
rIrJr?r'rmrqrwrxrr„r«rrrrÚ<module> s0     
t A