
    iԙ                        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r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rS SKJr  S SKJr  S SKJrJrJrJr  S SKJr  S SKJr  \(       a  S SKJr  \(       a	  S SKJs  Jr   \RB                  " \"5      r#S r$S	 r%S
 r&S r'       SS jr(S r)S r*S r+S r,SS jr-S r.S r/S r0SS jr1S r2S r3S r4SS jr5g)    N)compat)log)is_aix	is_darwinis_winis_linux)InvalidSrcDestTupleError)misc)versioninfoc                 <    X:w  a  [         R                  SU 5        gg)z'
Rebuild is required if values differ.
Building because %s changedTF)loggerinfo)	attr_name	old_value	new_value
last_builds       GC:\des-py\RoboSAPF\venv\Lib\site-packages\PyInstaller\building\utils.py_check_guts_eqr   /   s     19=    c                     U H8  u  pEn[         R                  " U5      U:  d  M"  [        R                  SU5          g   g)z
Rebuild is required if mtimes of files listed in old TOC are newer than last_build.

Use this for calculated/analysed values read from cache.
r   TF)r
   mtimer   r   )r   old_tocnew_tocr   	dest_namesrc_nametypecodes          r   _check_guts_toc_mtimer   9   s;     *1%	X::h*,KK5x@ *1 r   c                 @    [        XX#5      =(       d    [        XX#5      $ )z
Rebuild is required if either TOC content changed or mtimes of files listed in old TOC are newer than last_build.

Use this for input parameters.
)r   r   )r   r   r   r   s       r   _check_guts_tocr    F   s$     )gB Gi'FGr   c                    US:X  d   eU R                  S5      n[        R                  " U5      nUR                  US'   UR                  R                  S:X  ab  S[
        R                  R                   S[
        R                  R                   3nUR                  R                  R                  U:X  a  US/UQn[        R                  R                  " U6 $ )zm
Take a TOC entry (dest_name, src_name, typecode) and determine the full destination name for the extension.
	EXTENSION.zlib-dynloadpython)splitpathlibPathnameparentsysversion_infomajorminorospathjoin)module_namer   r   dest_elementssrc_path
python_dirs         r   destination_name_for_extensionr6   P   s    
 {"""  %%c*M ||H%H M"
 },c..445Qs7G7G7M7M6NO
??!!&&*4'GGM77<<''r   c	           
         SSK Jn	  U(       d  U(       d  [        (       d  U $ U=(       d    / nU(       aO  [        R                  " U 5      n
U H3  nU
R                  U5      (       d  M  [        R                  SX5        Sn  O   U(       a>  [        (       a3  [        R                  " U 5      (       a  [        R                  SU 5        SnU(       a3  [        R                  " U 5      (       a  [        R                  SU 5        SnU(       d  U(       a  [        (       a  [        R                  " U 5      n
U
R                  SU
R                    S35      nU
R#                  S	5      nUR%                  5       (       a  [        R                  S
U 5        S=p2O.UR%                  5       (       a  [        R                  SU 5        S=p2A
AAU(       d  U(       d  [        (       d  U $ S[&        R(                  S    [&        R(                  S    3n[*        R,                  " 5       S   n[.        R0                  R3                  U	S   SUS US U U 35      nU(       a   [.        R0                  R3                  UU5      n[        (       Ga
  U(       aT  [4        R6                  " UR9                  S5      5      n[.        R0                  R3                  UUR;                  5       5      nO [.        R0                  R3                  US5      nU(       ah  [=        US5       n[4        R6                  " UR?                  5       5      nSSS5        [.        R0                  R3                  UWR;                  5       5      nO [.        R0                  R3                  US5      n[.        R@                  " USS9  [.        R0                  R3                  US5      n [        RB                  " U5      n[.        R0                  RK                  U5      n[.        R0                  R3                  UU5      n[M        U 5      nUU;   a!  UUU   :X  a  U$ [.        RN                  " U5        [.        R@                  " [.        R0                  RQ                  U5      SS9  [R        RT                  " U U5        [.        RV                  " US5        U(       a  / n[        (       a  S/nO[X        (       a  S/nS/UQUPn[        R                  SSR3                  U5      5         [Z        R\                  " U[Z        R^                  [Z        R`                  [Z        Rb                  SS SS!9n[        Re                  S"URf                  5        U(       a  S&nU	S'   nU(       a   [.        R0                  R3                  UU5      n/ S(Qn [        (       a  U Rk                  S)5        U/U QUPn[        R                  SSR3                  U5      5         [Z        R\                  " U[Z        R^                  [Z        R`                  [Z        Rb                  SS SS!9n[        Re                  S*URf                  5        [        (       a   [l        Rn                  " UXPS-9  [q        [        R                  " S./[        R                  " U5      Rr                  Rt                   V!s/ s H  n!S/PM     sn!Q76 5      n"[l        Rv                  " UU"5        [l        Rx                  " UXg5        UUU'   [        R                  " UU5        U$ ! , (       d  f       GN= f! [D         a    0 n GNU[F         a    [        RI                  S5        e f = f! [Z        Rh                   af  nSn[X        (       a  S#URf                  ;   a  SnU(       a5  [        RI                  S$USS%9  [        RI                  S"URf                  5         SnAGNeSnAf[F         a    [        RI                  S$USS%9   GNf = f! [Z        Rh                   a@  n[        RI                  S+USS%9  [        RI                  S*URf                  5         SnAGNSnAf[F         a    [        RI                  S,USS%9   GNf = fs  sn!f ! [l        Rz                   a     GN[l        R|                   a"    U(       a  e [        Re                  S0U 5         GN[F         a  n[        S1U< S235      UeSnAff = f)3aw  
Process the collected binary using strip or UPX (or both), and apply any platform-specific processing. On macOS,
this rewrites the library paths in the headers, and (re-)signs the binary. On-disk cache is used to avoid processing
the same binary with same options over and over.

In addition to given arguments, this function also uses CONF['cachedir'] and CONF['upx_dir'].
r   CONFz8Disabling UPX for %s due to match in exclude pattern: %sFz Disabling UPX for %s due to CFG!z1Disabling UPX for %s due to it being a Qt plugin!r#   z.hmacz.chkzADisabling UPX and/or strip for %s due to accompanying .hmac file!z@Disabling UPX and/or strip for %s due to accompanying .chk file!py   cachedirbincachedzutf-8adhocrbNzno-entitlementsTexist_okz	index.datzIPyInstaller bincache may be corrupted; use pyinstaller --clean to fix it.i  z-Sz-X32_64stripzExecuting: %s ignore)stdinstdoutstderrcheckerrorsencodingzOutput from strip command:
%sz0654-419zFailed to run strip on %r!)exc_infoupxupx_dir)z--compress-icons=0z--lzmaz-qz--strip-loadconfzOutput from upx command:
%szFailed to upx strip on %r!zFailed to run upx on %r!)display_namez@loader_path..zCFile %s failed optional architecture validation - collecting as-is!zFailed to process binary !)APyInstaller.configr9   r   r'   PurePathmatchr   r   r   r   pefile_check_control_flow_guardr
   is_file_qt_pluginr   r(   	with_namer)   with_suffixis_filer+   r,   platformarchitecturer/   r0   r1   hashlibsha256encode	hexdigestopenreadmakedirsload_py_data_structFileNotFoundError	Exceptionwarningnormcase_compute_file_digestremovedirnameshutilcopyfilechmodr   
subprocessrunDEVNULLPIPESTDOUTdebugrG   CalledProcessErrorappendosxutilsbinary_to_target_archstrr*   partsset_dylib_dependency_pathssign_binaryInvalidBinaryErrorIncompatibleBinaryArchErrorSystemErrorsave_py_data_struct)#r   r   	use_stripuse_upxupx_excludetarget_archcodesign_identityentitlements_filestrict_arch_validationr9   r4   upx_exclude_entry	hmac_pathchk_pathpyverarch	cache_dircsi_hashfpef_hashcache_index_filecache_index	cached_idcached_name
src_digeststrip_optionscmdpeshow_warningupx_exerN   upx_optionsleveltarget_rpaths#                                      r   process_collected_binaryr   k   s   $ (
 WYY #K##H-!, ~~/00VX`t "- 66kII(SS6A 4))(33GR 	9((<<)&&8==/'?@	''/KK[]ef"''GiKKZ\de"''Gi WYY !!!$%c&6&6q&9%:;E  "1%DZ
9Q-{5'$8I GGLLK8	y~~&7&>&>w&GHHY0B0B0DEIY8I'."!..3 /Y0A0A0CDIY0ABIKK	D) ww||I{;../?@   +I'',,y)4K%h/JKY// 			+ KK,t<
 OOHk*HH[%  9!FMV 'KM444OSXXc]3	U ((!!(( A LL9188D  y/ggll7G4G
 61222k2OSXXc]3	S ((!!(( A LL7B y	S**;[  oWEUEUV_E`EgEgEmEm2nEmE4Em2noL //\J  .?S, (K	-{; /.    	bc	j ,, 
	KL v*0$;[SWX?J 	UNN7tNT	UF ,, 	ENN7tNTNN9188DD 	SNN5{TNR	S  3o ** 	 33 	j &LL^`hi 	S 9+JKQRR	Ss   %\>\ 8A$] A$_* Aa' &a"28a' 
\]	) ]	_' A_"_'&_'*a>5`99"aa"a' 'c>1c2	c;ccc                    ^ [         R                  " 5       n[        U S5       m[        U4S jS5       H  nUR	                  U5        M     S S S 5        [        UR                  5       5      $ ! , (       d  f       N'= f)Nr@   c                  &   > T R                  S5      $ )Ni @  )ra   )r   s   r   <lambda>&_compute_file_digest.<locals>.<lambda>g  s    "'')"4r   r   )r\   sha1r`   iterupdate	bytearraydigest)filenamehasherchunkr   s      @r   rh   rh   d  sY    \\^F	h	4c:EMM%  ; 
 V]]_%% 
	s   )A--
A;c                     SSK Jn  SnUS   R                  U 5      (       a  [        R	                  SXS   5        US-  nUS   R                  U 5      (       a  [        R	                  SXS   5        US-  nU(       a  [        SUS	   -  5      eg
)z
Check that path does not overlap with WORKPATH or SPECPATH (i.e., WORKPATH and SPECPATH may not start with path,
which could be caused by a faulty hand-edited specfile).

Raise SystemExit if there is overlap, return True otherwise
r   r8   workpathz;Specfile error: The output path "%s" contains WORKPATH (%s)r;   specpathz;Specfile error: The output path "%s" contains SPECPATH (%s)z\ERROR: Please edit/recreate the specfile (%s) and set a different output name (e.g. "dist").specT)rR   r9   
startswithr   error
SystemExit)r0   r9   specerrs      r   _check_path_overlapr   l  s     (GJ""4((RTX_iZjk1J""4((RTX_iZjk1jL
 	
 r   c                 D   [        U 5      (       au  [        R                  R                  U 5      (       d$  [        R                  R	                  U 5      (       a   [        R
                  " U 5        [        R                  " U SS9  gg! [         a    [        U 5         N.f = f)z9
Create a clean directory from the given directory name.
TrA   N)	r   r/   r0   isdirisfileri   OSError_rmtreerb   )r0   s    r   _make_clean_directoryr     sq     4  77=="''.."6"6		$ 	D4( !  s   B BBc                    SSK Jn  US   (       a  SnO@[        R                  R	                  5       (       a  [        SU -  5      nO[        SU -  5      eUR                  5       R                  5       S:X  aB  US   (       d  [        S5        [        R                  SU 5        [        R                  " U 5        g
[        S	5      e)zf
Remove directory and all its contents, but only after user confirmation, or if the -y option is set.
r   r8   	noconfirmyzXWARNING: The output directory "%s" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)zERROR: The output directory "%s" is not empty. Please remove all its contents or use the -y option (remove output directory without confirmation).zSOn your own risk, you can use the option `--noconfirm` to get rid of this question.zRemoving dir %szUser abortedN)rR   r9   r+   rG   isattyinputr   rC   lowerprintr   r   rk   rmtree)r0   r9   choices      r   r   r     s     (K					fimm
 79=>
 	
 ||~$K gh%t,d((r   c                 :   [        5       nU  GH	  u  p4U(       d  [        X44S5      eU(       d   [        X44S[        R                  < S35      e[        R                  R                  U5      (       a  [        X44S5      e[        R                  R                  U5      R                  S5      (       a  [        X44S5      eU(       aC  [        R                  R                  U5      (       d  [        R                  R                  X5      n[        R                  R                  U5      n[        R                  R                  U5      (       d$  [        R                  R                  U5      (       a  U/nSnO[        R                  " U5      nSnU(       d  [        S	U< S
35      eU GHj  n[        R                  R                  U5      (       a  UR                  [        R                  R                  [        R                  R                  U[        R                  R                  U5      5      5      [        R                  R                  U5      45        M  [        R                  R                  U5      (       d  M  [        R                  " U5       GHw  u  pn
UR                  U5      (       d   eU(       a>  [        R                  R!                  U[        R                  R#                  U5      5      nO[        R                  R!                  X5      n[        R                  R                  [        R                  R                  XK5      5      nU
 H  n[        R                  R                  X5      n[        R                  R                  U5      (       d  MH  UR                  [        R                  R                  [        R                  R                  X5      5      [        R                  R                  U5      45        M     GMz     GMm     GM     U$ )a>  
Convert the passed list of hook-style 2-tuples into a returned set of `TOC`-style 2-tuples.

Elements of the passed list are 2-tuples `(source_dir_or_glob, target_dir)`.
Elements of the returned set are 2-tuples `(target_file, source_file)`.
For backwards compatibility, the order of elements in the former tuples are the reverse of the order of elements in
the latter tuples!

Parameters
----------
binaries_or_datas : list
    List of hook-style 2-tuples (e.g., the top-level `binaries` and `datas` attributes defined by hooks) whose:
    * The first element is either:
      * A glob matching only the absolute or relative paths of source non-Python data files.
      * The absolute or relative path of a source directory containing only source non-Python data files.
    * The second element is the relative path of the target directory into which these source files will be
      recursively copied.

    If the optional `workingdir` parameter is passed, source paths may be either absolute or relative; else, source
    paths _must_ be absolute.
workingdir : str
    Optional absolute path of the directory to which all relative source paths in the `binaries_or_datas`
    parameter will be prepended by (and hence converted into absolute paths) _or_ `None` if these paths are to be
    preserved as relative. Defaults to `None`.

Returns
----------
set
    Set of `TOC`-style 2-tuples whose:
    * First element is the absolute or relative path of a target file.
    * Second element is the absolute or relative path of the corresponding source file to be copied to this target
      file.
zEmpty SRC is not allowed when adding binary and data files, as it would result in collection of the whole current working directory.z]Empty DEST_DIR is not allowed - to collect files into application's top-level directory, use r#   z!DEST_DIR must be a relative path!rP   zEDEST_DIR must not point outside of application's top-level directory!FTzERROR: Unable to find z# when adding binary and data files.)setr	   r/   curdirr0   isabsnormpathr   r1   r   r   globr   addbasenamewalkrelpathrj   )binaries_or_datas
workingdir	toc_datassrc_root_path_or_globtrg_root_dirsrc_root_pathswas_globsrc_root_pathsrc_dirsrc_subdir_basenamessrc_file_basenamesrel_dirtrg_dirsrc_file_basenamesrc_files                  r   format_binaries_and_datasr     s   D I/@+ %*&53 
 *&5o99-q"  77==&&*,A+PRuvv77L)44T::*&5W  bggmm,ABB$&GGLL$S! !# 0 01F G 77>>/00BGGMMBW4X4X34NH!YY'<=NH56K5NNqrss+Mww~~m,,GG$$RWW\\,@P@PQ^@_%`aGG$$]3  }--IKQ^I_EG3E #--m<<<<  "$''//'277??=;Y"Z"$''//'"I gg..rww||L/RSG-?)#%77<<#K77>>(33 &MM " 0 0g1Y Z\^\c\c\l\lmu\v+  .@' J` ,_ 0Af r   c                    US;  d   S5       e[         R                  R                  U5      u  p4UR                  5       nUS:X  a<  [        R                  SU5        [        U5      n[        R                  " USS 5      nU$ [        R                  SU5        [        US5       nUR                  5       nSSS5        [         R                  R                  U5      u  p4U(       d  [        R                  S	5        US
-  n [        WUSUS9nU$ ! , (       d  f       N_= f! [         a    [        R                  SU5        e f = f)zn
Get the code-object for a module.

This is a simplifed non-performant version which circumvents __pycache__.
>   N-z&Called with PEP-420 namespace package!.pycz%Reading code object from .pyc file %s   Nz&Compiling python script/module file %sr@   z-Appending .py to compiled entry-point name....pyexecoptimizezSytnax error while compiling %s)r/   r0   splitextr   r   rs   _read_pyc_datamarshalloadsr`   ra   compileSyntaxErrorrf   )	modnamer   r   _extpyc_datacode_objectfsources	            r   get_code_objectr   ,  s    ;&P(PP&WWh'FA
))+C
f} 	<hG!(+mmHRSM22 ) 	=xH(D!QVVXF " !!(+LLHIH	!&(FXNK
 % "!  	NN<hG	s   #D?D 
D"E c                 b   ^ [        U4S jU R                   5       5      nU R                  UTS9$ )z
Recursively replace the `co_filename` in the given code object and code objects stored in its `co_consts` entries.
Primarily used to anonymize collected code objects, i.e., by removing the build environment's paths from them.
c              3   ~   >#    U  H2  n[        U[        R                  5      (       a  [        UT5      OUv   M4     g 7fN)
isinstancetypesCodeTypereplace_filename_in_code_object).0const_cor   s     r   	<genexpr>2replace_filename_in_code_object.<locals>.<genexpr>`  s;      -H @J(TYTbTb?c?c'(;iqq-s   :=)	co_constsco_filename)tupler   replace)r   r   constss    ` r   r   r   Z  s:      #-- F
 XFFr   c                    U S   nUR                  S[        R                  R                   S[        R                  R                   S35      (       a  gU S   n[
        R
                  " US5      (       a  gUR                  S5      (       d  UR                  S	5      (       d  gU H   n[
        R
                  " X$5      (       d  M     g   g
)aW  
Return True if the given binary_tuple describes a system binary that should be included.

Exclude all system library binaries other than those with "lib-dynload" in the destination or "python" in the
source, except for those matching the patterns in the exceptions list. Intended to be used from the Analysis
exclude_system_libraries method.
r   r%   r#   z/lib-dynloadTr;   z*python*z/libz/usr/libF)r   r+   r,   r-   r.   fnmatch)binary_tuple
exceptionsdestsrc	exceptions        r   _should_include_system_binaryr
  h  s     ?D 0 0 6 67q9I9I9O9O8PP\]^^
q/CsJ''>>&!!#..*D*D	??4++   r   c                    U R                  S5      nSU;   a  UnSnO
USS nUS   n[        R                  R                  " U/UQUS-   P76 nU(       a  UR	                  U S5      OSn	U	c  [        R                  R                  U5      u  pUR                  5       nUS:X  a2  [        US5       nUR                  5       nSSS5        [        WUSUS	9n	O=US:X  a%  [        U5      n[        R                  " US
S 5      n	O[        SU SU S35      e[        R                  R                  " / UQUS-   P76 n[        X5      n	[        R                   " 5        nUR#                  [$        R&                  5        UR#                  [(        R*                  " SS5      5        UR#                  S5        [        R,                  " U	U5        UR/                  5       nSSS5        [        R                  R1                  U5      (       a-  [        US5       nUR                  5       nSSS5        WW:X  a  U$ [        R2                  " [        R                  R5                  U5      SS9  [        US5       nUR#                  W5        SSS5        U$ ! , (       d  f       GN= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       U$ = f)a  
Given the name and source file for a pure-python module, compile the module in the specified working directory,
and return the name of resulting .pyc file. The paths in the resulting .pyc module are anonymized by having their
absolute prefix removed.

If a .pyc file with matching name already exists in the target working directory, it is re-used (provided it has
compatible bytecode magic in the header, and that its modification time is newer than that of the source file).

If the specified module is available in binary-only form, the input .pyc file is copied to the target working
directory and post-processed. If the specified module is available in source form, it is compiled only if
corresponding code object is not available in the optional code-object cache; otherwise, it is copied from cache
and post-processed. When compiling the module, the specified byte-code optimization level is used.

It is up to caller to ensure that the optional code-object cache contains only code-objects of target optimization
level, and that if the specified working directory already contains .pyc files, that they were created with target
optimization level.
r#   __init__Nr$   r   r   r@   r   r   r   zInvalid python module file z; unhandled extension rQ   <Ir;              TrA   wb)r&   r/   r0   r1   getr   r   r`   ra   r   r   r   r   
ValueErrorr   ioBytesIOwriter   BYTECODE_MAGICstructpackdumpgetvaluer   rb   rj   )r)   r4   r   r   
code_cache
split_nameparent_dirsmod_basenamepyc_pathr   r   r   r   src_datar   r   
pyc_streamfhexisting_pyc_datas                      r   compile_pymoduler#  ~  sT   ( CJX !! !"o!"~ww||HJ{JL64IJH 1;*..t,K!!(+iik%<h%668 &!(HfxPKF] &h/H!--6K:8*DZ[^Z__`abb '',,BB\E-ABK1+KK
 
../T401$[*-&&( 
 
ww~~h(D!R "	 "((O KK)D9 
h	
 
 OS &%( 
 "! 
	 Os1   .JA>JJ*+J;
J
J'*
J8;
K
c                 *   [         R                  " U 5      nUR                  5       (       a  UR                  5       nU$ [        R
                  " U5      nUbu  [        R                  " U5      (       aZ  [        R                  " US5       n[        UR                  U5      R                  5       5      nUR                  U5      nSSS5        O[        SU < S35      eWSS [        R                  :w  a  [!        SU  S35      eU$ ! , (       d  f       N6= f)z
Helper for reading data from .pyc files. Supports both stand-alone and archive-embedded .pyc files. Used by
`compile_pymodule` and `get_code_object` helper functions.
NrzCannot find .pyc file rQ      zThe .pyc module z1 was compiled for incompatible version of python!)r'   r(   rY   
read_bytesr
   path_to_parent_archivezipfile
is_zipfileZipFilerx   relative_toas_posixra   rd   r   r  r  )r   r   r   parent_zip_filezip_archivezip_entry_names         r   r   r     s    
 ||H%H&&(" O 55h?&7+=+=o+N+N#6+!$X%9%9/%J%S%S%U!V&++N; 76
 $&<XL$JKK BQ<6000/z9jkllO 76s   	:D
Dc                    1 Skn/ nU  H  u  p4n[         R                  " U5      n[         R                  " U5      nUR                  [         R                  " S5      :X  a`  UR                  R                  R	                  5       U;   a8  [         R                  " UR                  R                  5      U-  n[        U5      nUR                  X4U45        M     U$ )z
Process the given `binaries` TOC list to apply work around for `pywin32` package, fixing the target directory
for collected extensions.
>   win32	pythonwinpywin32_system32r#   )r'   rS   r*   r)   r   rx   ru   )binariesPYWIN32_SUBDIRSprocessed_binariesr   r   r   	dest_pathr4   s           r    postprocess_binaries_toc_pywin32r9    s     AO)1%	X$$Y/	##H-w//449M9M9S9S9UYh9h(()=)=>JIII!!9"AB *2 r   c                 ,   S[         R                  S    [         R                  S    S3S[         R                  S    [         R                  S    S31n[        R                  " S5      [        R                  " S5      1n/ nU  H  u  pEn[        R                  " U5      nUR                  R                  5       U;   a>  UR                  U;   a.  [        R                  " S5      UR                  -  n[        U5      nUR                  XEU45        M     U$ )	z
Process the given `binaries` TOC list to apply work around for Anaconda `pywin32` package, fixing the location
of collected `pywintypes3X.dll` and `pythoncom3X.dll`.

pywintypesr   r;   z.dll	pythoncomr#   r2  r4  )	r+   r,   r'   rS   r)   r   r*   rx   ru   )r5  DLL_CANDIDATESDUPLICATE_DIRSr7  r   r   r   r8  s           r   )postprocess_binaries_toc_pywin32_anacondar?    s     S%%a()#*:*:1*=)>dC
C$$Q'()9)9!)<(=TBN 	!N
 )1%	X$$Y/	>>!^3	8H8HN8Z(();<y~~MIII!!9"AB *2 r   c           	         [         R                  " U S5       nU GH  u  pEnUc  SOUR                  US5      nUc  SSSS.U   n[        XEUS9nUR	                  S[
        R                  5      n	[
        R                  R                  [
        R                  R                  U5      5      u  pU
S	:X  a  U	[
        R                  S	-   -  n	U	S
-  n	[        XySS 5      n[        R                  " 5        nUR                  [        R                  5        UR                  [         R"                  " SS5      5        UR                  S5        [$        R&                  " X|5        [         R(                  " U	5      nUR+                  XR-                  5       5        SSS5        GM     SSS5        g! , (       d  f       GM  = f! , (       d  f       g= f)zd
Create a zip archive with python modules that are needed during python interpreter initialization.
wNr   r;      )PYMODULEz
PYMODULE-1z
PYMODULE-2r   r#   r  r   r$   r  r  )r)  r+  r  r   r  r/   sepr0   r   r   r   r  r  r  r   r  r  r  r   r  ZipInfowritestrr  )r   modules_tocr  zfr)   r4   r   codeoptim_levelr   r   r   fcr   s                 r   create_base_library_ziprL  2  sW    
3	'2(3$DH%-4:>>$3MD|+,AQOPXY&tLS"&&1IGG,,RWW-=-=h-GHMH:%RVVj00	I243BHD../T401$T&y1D++-0 ! )4 
(	'" # 
(	's%   CF<1B"F)F<)
F93	F<<
G
)FFNNNNFr   )6r  r   r\   r  r   r/   r'   rZ   rk   r  rn   r+   r   r)  PyInstallerr   r   loggingPyInstaller.compatr   r   r   r   PyInstaller.exceptionsr	   PyInstaller.utilsr
   PyInstaller.utils.win32r   PyInstaller.utils.osxutilsosxrv   	getLogger__name__r   r   r   r    r6   r   rh   r   r   r   r   r   r   r
  r#  r   r9  r?  rL   r   r   <module>rY     s       	  	      
    & B B ; "	3,,			8	$
G(<  vr&.))Bwt+\G,Sl:6#L1r   