
    i@                     j    S r SSKrSSKrSSKJr  SSKJr  \R                  " \5      r	S r
S rSS jrg)	z<
Configure PyInstaller for the current Python installation.
    N)compat)logc                    [         R                  S5        SnU (       a<  [        R                  R	                  [        R                  R                  X5      5      n [        R                  " US/[        R                  [        R                  SS9n UR                  5       S   n[         R                  S
U5        g! [         a    [         R                  S5         gf = f! [         a    S	n NJf = f)NzTesting UPX availability ...upxz-Vzutf-8)stdinstderrencodingzUPX is not available.Fr   zversion string unavailablezUPX is available: %sT)loggerdebugospathnormpathjoin
subprocesscheck_outputDEVNULL	Exception
splitlines
IndexError)upx_dirupx_exeoutputversion_strings       BC:\des-py\RoboSAPF\venv\Lib\site-packages\PyInstaller\configure.py_check_upx_availabilityr      s    
LL/0G''""277<<#AB	((dO$$%%	
6**,Q/ LL'8  ,-  656s$   5B< C! <CC!C0/C0c                  h   S n [         R                  " S5      (       a  [         R                  " S5      nO[         R                  (       a=  [         R                  " S5      nU(       d  [        R                  R                  S5      nO[         R                  (       a   [        R                  R                  S5      nOx[         R                  " S5      n U (       d  [        R                  R                  S5      n [         R                  " S5      nU(       d  [        R                  R                  S5      n[        R                  R                  US	5      nU (       a  [        R                  R                  U5      (       d  [        R                  R                  U S	5      n [        R                  R                  U 5      (       ao  [        R                  R                  U5      n[        R                  R                  U5      (       d  [        R                  " U5        [        R                  " X5        U$ )
NPYINSTALLER_CONFIG_DIRLOCALAPPDATAz~\Application Dataz~/Library/Application SupportXDG_DATA_HOMEz~/.local/shareXDG_CACHE_HOMEz~/.cachepyinstaller)r   getenvis_winr   r   
expanduser	is_darwinr   existsdirnamemakedirsrename)old_cache_dir	cache_dir
parent_dirs      r   _get_pyinstaller_cache_dirr-   5   sS   M}}-..MM":;		MM.1	**+@AI			GG&&'FG	 o6GG../?@MMM"23	**:6IY6IRWW^^I66]MB77>>-((3J77>>*--J'IIm/    c                 z   0 n[        5       US'   XS'   [        U 5      nU(       a  [        R                  (       d  [        R                  (       a  [
        R                  S5        OQ[        R                  R                  SS5      S:w  a  [
        R                  S5        OSn[
        R                  S5        X!S	'   U$ )
Ncachedirr   z>UPX is available and will be used if enabled on build targets.PYINSTALLER_FORCE_UPX0zcUPX is available and force-enabled on platform with known compatibility problems - use at own risk!FzTUPX is available but is disabled on non-Windows due to known compatibility problems.upx_available)r-   r   r   r#   	is_cygwinr
   infor   environgetwarning)r   configr3   s      r   
get_configr:   S   s    F35F:9 ,G4M==F,,KKXYZZ^^3S9S@NNu "MKKno+?Mr.   )N)__doc__r   r   PyInstallerr   r   logging	getLogger__name__r
   r   r-   r:    r.   r   <module>rA      s7    
   &			8	$:<r.   