
     hi@                     h    d Z ddlZddlZddlmZ ddlmZ  ej                  e      Z	d Z
d ZddZy)	z<
Configure PyInstaller for the current Python installation.
    N)compat)logc                    t         j                  d       d}| r=t        j                  j	                  t        j                  j                  | |            }	 t        j                  |dgt        j                  t        j                  d      }	 |j                         d   }t         j                  d
|       y# t        $ r t         j                  d       Y yw xY w# t        $ r d	}Y Hw xY w)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       AC:\des-py\Monitor\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$   7B: C :CCC,+C,c                     d } t        j                  d      rt        j                  d      }nt         j                  r7t        j                  d      }|st        j                  j                  d      }nt         j                  r t        j                  j                  d      }nlt        j                  d      } | st        j                  j                  d      } t        j                  d      }|st        j                  j                  d      }t        j                  j                  |d	      }| rt        j                  j                  |      st        j                  j                  | d	      } t        j                  j                  |       rit        j                  j                  |      }t        j                  j                  |      st        j                  |       t        j                  | |       |S )
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   sH   M}}-.MM":;		MM.1	**+@AI			GG&&'FG	 o6GG../?@MMM"23	**:6IY6IRWW^^I6]MB77>>-(3J77>>*-J'IImY/    c                 ^   i }t               |d<   | |d<   t        |       }|rt        j                  st        j                  rt
        j                  d       nPt        j                  j                  dd      dk7  rt
        j                  d       nd}t
        j                  d       ||d	<   |S )
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:F9 ,G4M==F,,KKXYZZ^^3S9S@NNu "MKKno+F?Mr.   )N)__doc__r   r   PyInstallerr   r   logging	getLogger__name__r
   r   r-   r:    r.   r   <module>rA      s9    
   &			8	$:<r.   