
    iJ                        S SK r S SKrS SKrS SKrS SKrS SKrS SKJr  S SKJ	r	J
r
Jr  S SKJr  S SKJr  S SKJr  S SKJr  \R&                  " \5      r " S S	5      rS
 rS rS r\R4                  S 5       rS rS rS rSqSS jr SS jr!g)    N)_resolveCtypesImports)collect_submodulescollect_system_data_filesget_hook_config)isolated)log)compat)findSystemLibraryc                   *    \ rS rSrSS jrS rS rSrg)GiModuleInfo   Nc                    Xl         X l        SU l        / U l        S U l        / U l        Ub*  [        USS5      nU(       a  UR                  X5      U l        [        R                  SXR                  5        [        R                  S 5       n U" XR                  5      nUc!  [        R                  SXR                  5        g [        R                  SXR                  5        US   U l        US	   U l        US
   U l        SU l        g ! [         a+  n[        R                  SXR                  U5         S nAg S nAff = f)NFgizmodule-versionsz"Gathering GI module info for %s %sc                    SS K n UR                  SS5        SnSSKJn  U(       aI  UR                  5       n UR                  XUR                  R                  5        UR                  U 5      nOUR
                  R                  5       n UR                  XUR                  R                  5        UR                  U 5      nU(       a/  UR                  S5       Vs/ s H  owR                  5       PM     snO/ nUR                  U 5      n[!        US	5      (       a  UR#                  U 5      n	OUR%                  U 5      n	UUU	S
.$ ! [         a    UR                  SS5        Sn GNLf = f! [         a     g f = f! [         a     g f = fs  snf )Nr   GIRepositoryz3.0T2.0F)r   ,get_immediate_dependencies)
sharedlibstypelibdependencies)r   require_version
ValueErrorgi.repositoryr   
RepositoryrequireRepositoryLoadFlagsLAZYget_shared_librariesget_defaultIREPOSITORY_LOAD_FLAG_LAZYget_shared_librarysplitstripget_typelib_pathhasattrr   get_dependencies)
moduleversionr   new_apir   repor   libr   r   s
             GC:\des-py\RoboSAPF\venv\Lib\site-packages\PyInstaller\utils\hooks\gi.py_get_module_info/GiModuleInfo.__init__.<locals>._get_module_info-   s    "">59
 3 #..0 LL,2R2R2W2WX
 "66v>
#..::< LL,2R2R2m2mn "44V<
OYZ5E5Ec5JK5Jciik5JK_a
 ++F3G t9::#>>vF#44V< )" , O   "">59  "    "    Ls:   E &E* &E: F
E'&E'*
E76E7:
FFzGI module info %s %s not found.zGI module info %s %s found.r   r   r   Tz#Failed to query GI module %s %s: %s)namer)   	availabler   r   r   r   getloggerdebugr   decorate	Exceptionwarning)selfr(   r)   hook_apimodule_versionsr.   infoes           r-   __init__GiModuleInfo.__init__   s   	 -h>OPO.226C96<<P			7	 
7	t	[#FLL9D|>U:FLLQ"&|"4#I$($8!!% 	[NN@&,,XYZZ	[s   5D	 AD	 	
D>!D99D>c           	         U R                   (       d&  [        SU R                   SU R                   S35      eU R                  (       d  gU R                   HS  n[        U5      nU(       d  M  [        R                  R                  [        R                  R                  U5      5      s  $    [        SU R                   SU R                   SU R                   S35      e)aM  
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: !)
r1   r   r0   r)   r   r
   ospathnormpathdirname)r8   r,   rE   s      r-   
get_libdirGiModuleInfo.get_libdiru   s     ~~wtyyk4<<.@PQRR??C$S)Dtww''(=>> # CDII;aPTP\P\~]_`d`o`o_ppqrss    c                   ^  / n/ n/ n[         R                  ST R                  T R                  5        T R                  (       d&  [        ST R                   ST R                   S35      e[        T R                  5      nU H6  n[         R                  SUS   US   5        UR                  US   S45        M8     [        T R                  5      nU(       a*  [         R                  S	US   5        UR                  U5        U[        S
U 4S j5      -  nT R                   H   nUR                  SS5      u  pUSU 3/-  nM"     X!U4$ )z[
Return a tuple of (binaries, datas, hiddenimports) to be used by PyGObject related hooks.
z Collecting module data for %s %sr@   rA   rB   z"Collecting shared library %s at %sr      .zCollecting gir typelib at %szgi.overridesc                 @   > U R                  STR                  -   5      $ )NrM   )endswithr0   )r0   r8   s    r-   <lambda>3GiModuleInfo.collect_typelib_data.<locals>.<lambda>   s    WZ]a]f]fWfIgrJ   -zgi.repository.)r3   r4   r0   r)   r1   r   r   r   appendgir_library_path_fixr   r   r   rsplit)
r8   datasbinarieshiddenimportsresolved_libsresolved_libtypelib_entrydep
dep_module_s
   `         r-   collect_typelib_data!GiModuleInfo.collect_typelib_data   s1    7DLLQ ~~wtyyk4<<.@PQRR .doo>)LLL=|AP\]^P_`OO\!_c23 * -T\\:LL7q9IJLL' 	+N<ghh $$CJJsA.MJzl;<<M % --rJ   )r1   r   r0   r   r   r)   N)__name__
__module____qualname____firstlineno__r=   rH   r_   __static_attributes__ rJ   r-   r   r      s    V[pt&#.rJ   r   c                 8    [        X5      nUR                  5       $ ra   )r   rH   r(   r)   module_infos      r-   get_gi_libdirrk      s    v/K!!##rJ   c                 8    [        X5      nUR                  5       $ )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   r_   ri   s      r-   get_gi_typelibsrm      s     v/K++--rJ   c           	         SS K nSSKJn  [        R                  R                  U 5      n [        R                  (       Ga   [        R                  R                  [        R                  U /5      nUS:X  aT  [        R                  S5        [        R                  R                  [        R                  R                  U SSS5      5      n[        R                  R                  USS5      n[        R                  R                  U 5      n[        R                  R                  U5      S   S-   n[        R                  R                  XF5      n[        R                  R                  U5      (       d  [        R!                  S	U5        g [        R                  R                  U5      (       d  [        R!                  S
U5        g [#        USSS9 nUR%                  5       n	S S S 5        [#        [        R                  R                  US   U5      SSS9 nW	 H  n
SU
;   a  [&        R(                  " SU
5      n[&        R(                  " SUS   5      n[+        U5       H1  u  pSU;   d  M  S[        R                  R                  U5      -   X'   M3     SR                  USS 5      SR                  U5      -   n
UR-                  U
5        M     S S S 5        UR.                  " S[        R                  R                  US   U5      S[        R                  R                  US   U5      45      nUR1                  5         [        R                  R                  US   U5      S4$ U S4$ ! , (       d  f       GN= f! , (       d  f       N= f)Nr   )CONF/z+virtualenv detected? fixing the gir path...z..sharezgir-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.rutf-8)encodingworkpathwzshared-libraryz(=)z(["|,])   r,   z@loader_path/ zg-ir-compilerz-ogi_typelibs)
subprocessPyInstaller.configro   rD   rE   abspathr	   	is_darwincommonprefixbase_prefixr3   r4   joinbasenamesplitextexistserroropen	readlinesrer#   	enumeratewritePopenwait)rE   rz   ro   common_pathgir_pathtypelib_namegir_namegir_fileflinesliner#   filescountitemcommands                   r-   rT   rT      s    (77??4 D  gg**F,>,>+EF#LLFG''//"'',,tT4*NOK77<<Wi@ww''-77##L1!4v=77<<3ww~~h''LLr ww~~h''LLmow (C'2aKKME 3 "'',,tJ/:C'RVW#t+HHUD1EHHYa9E'0'7 D=+:RWW=M=Md=S+SEL (8 7751:.?D  S ""RWW\\$z*:HE"'',,tJ/>$
  	ww||D,l;]JJ]""1 32 SRs    M$AM6(A#M6$
M36
Nc                  Z    SS K n U R                  SS5        SSKJn  UR	                  5       $ Nr   GLibr   )r   )r   r   r   r   get_system_data_dirsr   r   s     r-   get_glib_system_data_dirsr     s'    vu%"$$&&rJ   c                      [         R                  (       a+  [        R                  R	                  [        SS5      S5      /$ [        R                  S 5       n U $ )z5
Try to return the sysconf directories (e.g., /etc).
r   r   etcc                  Z    SS K n U R                  SS5        SSKJn  UR	                  5       $ r   )r   r   r   r   get_system_config_dirsr   s     r-   	data_dirs(get_glib_sysconf_dirs.<locals>.data_dirs  s'    
65)&**,,rJ   )r	   is_winrD   rE   r   rk   r   call)r   s    r-   get_glib_sysconf_dirsr   
  sJ     }} ]6595ABB]]- - rJ   c                      [        5       nUc  / $ [        R                  R                  " S/U Q76 n/ nU H1  n[        R                  R                  " U/U Q76 nU[	        XRSS9-  nM3     U$ )zC
Path is relative to the system data directory (e.g., /usr/share).
rq   Fdestdirinclude_py_files)r   rD   rE   r   r   )rE   glib_data_dirsr   	collecteddata_dirps         r-   collect_glib_share_filesr     sq     /0N	ggll7*T*G I"GGLL)D).qTYZZ	 # rJ   c                      [        5       nUc  / $ [        R                  R                  " S/U Q76 n/ nU H1  n[        R                  R                  " U/U Q76 nU[	        XRSS9-  nM3     U$ )z?
Path is relative to the system config directory (e.g., /etc).
r   Fr   )r   rD   rE   r   r   )rE   glib_config_dirsr   r   
config_dirr   s         r-   collect_glib_etc_filesr   0  sr     -.	ggll5(4(G I&
GGLL+d+.qTYZZ	 ' rJ   c                 n   [         cH  Ub:  / nU H/  nU[        [        R                  R	                  SU5      5      -  nM1     Uq O[        S5      q [        R
                  U -   S-   [        R
                  U -   S-   /n[        US   5      n[          VVs/ s H  u  pgXe* S U;   d  M  Xg4PM     snn$ s  snnf )zY
Return a list of translations in the system locale directory whose names equal prog.mo.
Nlocalez.moz.por   )_glib_translationsr   rD   rE   r   seplen)prog	lang_listtranslangnamesnamelensrcdsts           r-   collect_glib_translationsr   F  s    
 ! E!1"'',,x2NOO "!&!9(!CVVd]U"BFFTME$9:E%(mG'9U'983S^u=TJSJ'9UUUs   B1&B1c           
      ,   [         R                  " S5      n[         R                  " U5      n/ n/ nU  Hz  nUu  pxn	[         R                  " U5      n[         R                  " U5      nUR                  U:w  a  UR	                  U5        MW  UR
                  S;   a  Mi  UR	                  U5        M|     U(       d  U $ [        R                  " S5      n
U
(       d  [        R                  S5        U $ US-  nSnSnUR                  5       (       aB  UR                  5       n[        R                  " UR                  5       5      R                  5       nUR!                  5       (       a  [        R"                  " U5        UR%                  SS9  U H  n[        R&                  " X5        M     [        R)                  S	[+        U5      5         U
[+        U5      S
[+        U5      /n[,        R.                  " U[,        R0                  [,        R2                  [,        R4                  SSSS9n[        R7                  SUR8                  5        Ubb  [        R                  " UR                  5       5      R                  5       nUU:X  a*  [>        R@                  " XRB                  URD                  4S9  UR	                  [+        X;R
                  -  5      [+        U5      S45        U(       a;  U H5  nUR	                  [+        X>R
                  -  5      [+        U5      S45        M7     U$ ! [,        R:                   a@  n[        R                  SSS9  [        R                  SUR8                  5        U s SnA$ SnAf[<         a    [        R                  SSS9  U s $ f = f)a5  
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`.
zshare/glib-2.0/schemas>   gschema.dtdgschemas.compiledzglib-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ignorers   )stdinstdoutstderrcheckerrorsrt   z$Output from glib-compile-schemas:
%szBFailed to recompile GLib schemas! Returning collected files as-is!)exc_info)nsDATA)#pathlibPurePathPathparentrS   r0   shutilwhichr3   r7   is_filestathashlibsha1
read_bytesdigestr   rmtreemkdircopyr;   strrz   runDEVNULLPIPESTDOUTr4   r   CalledProcessErrorr6   rD   utimest_atime_nsst_mtime_ns)	datas_tocworkdircollect_source_filesSCHEMA_DEST_DIRschema_files
output_toc	toc_entry	dest_namesrc_nametypecodeschema_compiler_execompiled_fileold_compiled_file_hashold_compiled_file_statschema_filecmd_argsr   r<   new_compiled_file_hashs                      r-   compile_glib_schema_filesr   \  s    &&'?@Oll7#GLJ	(1%	X$$Y/	##H- .i( ==@@H%) .  !,,'=>uv 11M!!!.!3!3!5!(m.F.F.H!I!P!P!R ~~gMM4M  $K) $ KK@#g,O'W}c'lSNN$$??$$
 	<ahhG )!(m.F.F.H!I!P!P!R!%;;HH](J(JLbLnLn'op s?-?-??@#mBTV\]^ 'Ks?5E5E#EFKHXZ`ab ( 3 ((  	[fjk>I [fjks%   A<L N25M-'N-#NNra   )F)"rD   r   r   rz   r   r   PyInstaller.depend.utilsr   PyInstaller.utils.hooksr   r   r   PyInstallerr   r   loggingr	   PyInstaller.depend.bindependr
   	getLoggerrb   r3   r   rk   rm   rT   r5   r   r   r   r   r   r   r   rg   rJ   r-   <module>r      s    
     	 : b b   &  :			8	$O. O.f$	.>#B 
' '&&&  V,mrJ   