
    wBf                        d Z ddlZddlZddlZddlZddlZddlmZ ddlm	Z	 ddl
m
Z
 ddlmZ ddlmZ ddlmZmZmZmZmZmZmZmZ dd	lmZ dd
lmZ ddlmZmZ ddlmZ  ddl!m"Z"m#Z#m$Z$m%Z%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5m6Z6m7Z7m8Z8m9Z9 ddl:m;Z; ddl<m=Z=m>Z> ddl?m@Z@ ddlAmBZB ddlCmDZD ddlEmFZF ddlGmHZH ddlImJZJ e2rddlKZKddlLmMZMmNZN ddlOmPZP  eeQ      ZRdZSd ZT G d! d"      ZUd# ZV	 dXd$ZWdYd%ZXd& ZYd' ZZd( Z[	 dXd)Z\d* Z]d+ Z^d, Z_d- Z`dZd.Zad/ Zbd0 Zcd1 Zdd2 Zed3 Zfd4 Zgd5 Zhd6 Zid7 Zjd8 Zkd9 Zld: Zmd; Znd< Zod= Zpd> Zqd? Zrd@ ZsdA ZtdB ZudC ZvdD ZwdE ZxdF ZydG ZzdH Z{dXdIZ|dXdJZ}dK Z~dL ZdXdMZdN ZdO ZdP ZdQ ZdR ZdS ZdT ZdU ZdV ZeQdWk(  r#e2rej                  d   Z e`e       y e_        yy)[a  Backend logic for `conda init`.

Sections in this module are

  1. top-level functions
  2. plan creators
  3. plan runners
  4. individual operations
  5. helper functions

The top-level functions compose and execute full plans.

A plan is created by composing various individual operations.  The plan data structure is a
list of dicts, where each dict represents an individual operation.  The dict contains two
keys--`function` and `kwargs`--where function is the name of the individual operation function
within this module.

Each individual operation must

  a) return a `Result` (i.e. NEEDS_SUDO, MODIFIED, or NO_CHANGE)
  b) have no side effects if context.dry_run is True
  c) be verbose and descriptive about the changes being made or proposed is context.verbose

The plan runner functions take the plan (list of dicts) as an argument, and then coordinate the
execution of each individual operation.  The docstring for `run_plan_elevated()` has details on
how that strategy is implemented.

    N)unified_diff)ENOENT)glob)chain)	getLogger)abspathbasenamedirnameexists
expanduserisdirisfilejoin)Path)randint   )CONDA_PACKAGE_ROOT
CondaError)__version__)CshActivatorFishActivatorPosixActivatorPowerShellActivatorXonshActivator)Utf8NamedTemporaryFile)dals)context)ensure_binaryensure_text_typeensure_utf8_encodingon_macon_winopen)expandget_bin_directory_short_pathget_python_short_path#get_python_site_packages_short_pathwin_path_ok)CondaValueError)copymkdir_p)rm_rf)lexists)make_executable)compute_sum)subprocess_call   ) generate_shebang_for_entry_point)FOLDERIDget_folder_path)create_shortcutzV^# >>> conda initialize >>>(?:\n|\r\n)([\s\S]*?)# <<< conda initialize <<<(?:\n|\r\n)?zD^#region conda initialize(?:\n|\r\n)([\s\S]*?)#endregion(?:\n|\r\n)?c                       e Zd ZdZdZdZy)Resultz
needs sudomodifiedz	no changeN)__name__
__module____qualname__
NEEDS_SUDOMODIFIED	NO_CHANGE     5lib/python3.12/site-packages/conda/core/initialize.pyr7   r7   h   s    JHIr@   r7   c                     t        |       }t        |       t        j                  st	        d |D              rJ t        |       y)Nc              3   H   K   | ]  }|d    t         j                  k(    ywresultNr7   r<   .0steps     rA   	<genexpr>zinstall.<locals>.<genexpr>w   s     LttH~):)::L    "r   )make_install_planrun_planr   dry_runanyprint_plan_results)conda_prefixplans     rA   installrS   s   s9    \*DTN??LtLLLLtr@   c                    g }t        j                  d      dk(  r1t        |       }t        |       t        j
                  st        |       t        | |||||      }t        |       t        j
                  st        |       ||z   }t        |       t        d |D              rt        dt        j                         yy )NCONDA_PIP_UNINITIALIZEDtrue)reversec              3   H   K   | ]  }|d    t         j                  k(    ywrD   rF   rG   s     rA   rJ   zinitialize.<locals>.<genexpr>        
@44>V...
@rK   zOperation failed.filer1   )osgetenvrL   rM   r   rN   run_plan_elevatedmake_initialize_planrP   rO   printsysstderr)	rQ   shellsfor_user
for_systemanaconda_promptrW   plan1plan2rR   s	            rA   
initializeri   |   s     E	yy*+v5!,/e$ fh
OWE UO??% 5=Dt

@4
@@!

3 Ar@   c           	         t        |xs t        j                        }t        |xs t        j                               }t        |      \  }}}t        t        |dd            st        d|z        t        |      }|j                  t        j                  d|id       |j                  t        j                  t        |d      |dd       |j                  t        j                  t        |d      |dd       |j                  t        j                  dt        |d	      id       t!        |       t"        j$                  st"        j&                  rt)        |t        j*                         t-        d
 |D              rt/        d      t1        dd      |d   t2        rdndd}d}	| dk(  r&t5        dj                  t7        |||	                   y| dk(  rt9        |||	      }
t"        j$                  s5t;        dd      5 }|j=                  dj                  |
             d d d        t"        j&                  rt5        dj                  |
             t5        d       yt?               # 1 sw Y   IxY w)Ncondaz__main__.pyz(Directory is not a conda source root: %starget_pathfunctionkwargsconda.egg-link)rl   conda_source_rootzeasy-install.pthzconda.egg-infoc              3   H   K   | ]  }|d    t         j                  k(    ywrD   rF   rG   s     rA   rJ   z!initialize_dev.<locals>.<genexpr>   rY   rK   zGOperation failed. Privileged install disallowed for 'conda init --dev'.r   l        winunix)PYTHONHASHSEEDPYTHON_MAJOR_VERSIONTEST_PLATFORM)
CONDA_DEFAULT_ENV	CONDA_EXE_CE_M	_CE_CONDACONDA_PREFIXCONDA_PREFIX_1CONDA_PREFIX_2CONDA_PYTHON_EXECONDA_PROMPT_MODIFIERCONDA_SHLVLbash
cmd.exezdev-init.batwznow run  > .\dev-init.bat) r$   ra   prefixr\   getcwd_get_python_infor   r   r)   rL   appendremove_conda_in_sp_dirr9   make_conda_egg_linkmodify_easy_install_pthmake_dev_egg_info_filerM   r   rN   verboserP   rb   rO   r   r   r"   r`   _initialize_dev_bash_initialize_dev_cmdexer#   writeNotImplementedError)shelldev_env_prefixrq   r   
python_exepython_versionsite_packages_dirrR   env_varsunset_env_varsscriptfhs               rA   initialize_devr      sB    N0cjj1F0?BIIK@4DV4L1J 1$('=AB69JJ
 	
 V$DKK.770	
 	KK+44#$57GH%6	
 	KK/88#$57IJ%6	
 	KK.77t$57GH	
 TN'//4,

@4
@@U
 	

 "!Z0 .q 1"(fH
N dii,VX~NOP  
)	'.Inc* ,b6*+,??$))F#$*+  "##, ,s   !I..I7c              #     K   t        t        j                        }t        rd| d}d |D        E d {    d t	        |j                               D        E d {    d| d t        j                  r	d|  d y y 7 N7 (w)	Nz$(cygpath 'z')c              3   &   K   | ]	  }d |   yw)zunset Nr?   rH   envvars     rA   rJ   z'_initialize_dev_bash.<locals>.<genexpr>   s     ?f&!?s   c              3   4   K   | ]  \  }}d | d| d  yw)zexport z=''Nr?   rH   r   values      rA   rJ   z'_initialize_dev_bash.<locals>.<genexpr>   s(      )6'&E7!$   z	eval "$("z" -m conda shell.bash hook)"zconda activate 'r   )r   ra   
executabler"   sorteditemsr   auto_activate_base)r   r   r   sys_executables       rA   r   r      s     S^^,N&~&6b9 @???:@AQ:R  
 n%%A
BB !! ** " @s!   2BB'BB'BBc              #   <  K   d}t         j                  rd}t        | d      }d d |D        E d {    d t        |j	                               D        E d {    d|dz   d	|  d
 t         j
                  rd|dz   d| d|  d d
 y y 7 d7 >w)N z--devcondabinzo@IF NOT "%CONDA_PROMPT_MODIFIER%" == "" @CALL SET "PROMPT=%%PROMPT:%CONDA_PROMPT_MODIFIER%=%_empty_not_set_%%%"c              3   (   K   | ]
  }d | d  yw)z@SET =Nr?   r   s     rA   rJ   z)_initialize_dev_cmdexe.<locals>.<genexpr>  s     ?f%xq!?s   c              3   4   K   | ]  \  }}d | d| d  yw)z@SET "r   "Nr?   r   s      rA   rJ   z)_initialize_dev_cmdexe.<locals>.<genexpr>  s(      '4vu&%"r   z@CALL "conda_hook.batz" z,@IF %ERRORLEVEL% NEQ 0 @EXIT /B %ERRORLEVEL%	conda.batz" activate z "r   )r   devr   r   r   r   )r   r   r   dev_argr   s        rA   r   r     s     G{{FJ'H	R @???8>x~~?O8P  
 H//07)
<<
88 !!;./{7)2fXQOO<< " @s!   1BB'BB=BBc           
      j	   	 t        |       \  }}}g }t        r{t        | dd      }t        | dd      }|j	                  t
        j                  t        | dd      | dd       |j	                  t
        j                  t        | dd      | dd       nL|j	                  t        j                  t        | d	d
      | dddd       t        | dd
      }t        | dd      }|j	                  t        j                  || dddd       |j	                  t        j                  || dddd       t        r|j	                  t        j                  t        | d	d      | dd       |j	                  t        j                  t        | ddd      | dd       |j	                  t        j                  t        | d	d      | dd       |j	                  t        j                  t        | d	d      | dd       |j	                  t        j                  t        | d	d      | dd       |j	                  t        j                  t        | d	d      | dd       |j	                  t        j                  t        | dd      | dd       |j	                  t        j                  t        | d	d      | dd       |j	                  t         j                  t        | d	d      | dd       |j	                  t"        j                  t        | t%               d      | dd       |j	                  t&        j                  t        | t%               d      | dd       |j	                  t(        j                  t        | ddd      | dd       |j	                  t*        j                  t        | dddd       | dd       |j	                  t,        j                  t        | d!d	d"      | dd       |j	                  t.        j                  t        | d!d	d#      | dd       |r1|j	                  t0        j                  t        |d$d%      | dd       nt3        d&| z  t4        j6                  '       |j	                  t8        j                  t        | ddd(      | dd       |S # t        $ r
 d\  }}}Y w xY w))N)NNNScriptszconda-script.pyzconda-env-script.py	conda.exe)rl   rQ   rm   zconda-env.exer   rk   	conda.climain)rl   rQ   modulefuncbinz	conda-envzconda_env.cli.mainr   Library_conda_activate.batrename_tmp.batconda_auto_activate.batr   activate.batdeactivate.batactivate
deactivateetcz	profile.dzconda.shfishzconf.dz
conda.fishr   
Conda.psm1zconda-hook.ps1xontribz	conda.xshzPWARNING: Cannot install xonsh wrapper without a python interpreter in prefix: %srZ   z	conda.csh)r   OSErrorr"   r   r   make_entry_point_exer9   make_entry_pointinstall_condabin_conda_batinstall_library_bin_conda_bat#install_condabin_conda_activate_batinstall_condabin_rename_tmp_bat(install_condabin_conda_auto_activate_batinstall_condabin_hook_batinstall_Scripts_activate_batinstall_activate_batinstall_deactivate_batinstall_activater%   install_deactivateinstall_conda_shinstall_conda_fishinstall_conda_psm1install_conda_hook_ps1install_conda_xshr`   ra   rb   install_conda_csh)rQ   r   r   r   rR   conda_exe_pathconda_env_exe_paths          rA   rL   rL   %  s   I8H8V5
N$5 D
 lI7HI!,	;PQ099#'i#M$0	
 	099#'i#Q$0	
 	,55#'j'#J$0)"	
	
 lE7;!,{CKK(11- ,%		

 	KK(111 ,.		
  6??#'j+#N$0	
 	9BB#'i#T$0	
 	?HH#'$j2G$ %1	
	
 	;DD#'jBR#S$0	
 	DMM#'$j2K$ %1	
	
 	5>>#'jBR#S$0	
 	8AA#'i#P$0	
 	099#'j.#Q$0	
 	2;;#'jBR#S$0	
 	KK(11# ">"@*  !-		

 	KK*33# ">"@,  !-		

 	KK(11#L%jQ ,	
 	KK*33# %<  !-		

 	KK*33#L':|T ,	
 	KK.77# ':7G  !-		

 -66#'(99k#R$0	
 	 	

 	KK)22#L%kR ,	
 Ko  I8H5
N$5Is   R R21R2c                 t   t        |       }t        |      }|ddhz  rd|v rL|rJt        t        dt        st
        rdnd            }|j                  t        j                  || d|dd       d|v rf|rddt        j                  v rt        t        d	d
            }nt        t        dd
            }|j                  t        j                  || d|dd       |r&|j                  t        j                  d| |dd       d|v r~|r=t        t        dddd            }	|j                  t        j                  |	| |dd       |r=t        t        dddd            }	|j                  t        j                  |	| |dd       d|v r|r;t        t        dd            }
|j                  t        j                  |
| |dd       |rEt
        rt        t        ddd            }
nd}
|j                  t        j                  |
| |dd       d|v r>|r<t        t        dd            }|j                  t        j                  || d|dd       d|v rP|rd|rdfd}t         |ddd            }|D ]+  }||j                  t        j                  || |dd       - d|v r|r&|j                  t        j                  d| |dd       |rJ|j                  t        j                  d| |dd       |j                  t         j                  d d!id       |r|j                  t"        j                  t        | d"d#      | |dd       t
        r t%        t&        j(                        \  }}|rJ t        t+        d      d$      }|j                  t"        j                  t        |d#      | |dd       |S )%aI  
    Creates a plan for initializing conda in shells.

    Bash:
    On Linux, when opening the terminal, .bashrc is sourced (because it is an interactive shell).
    On macOS on the other hand, the .bash_profile gets sourced by default when executing it in
    Terminal.app. Some other programs do the same on macOS so that's why we're initializing conda
    in .bash_profile.
    On Windows, there are multiple ways to open bash depending on how it was installed. Git Bash,
    Cygwin, and MSYS2 all use .bash_profile by default.

    PowerShell:
    There's several places PowerShell can store its path, depending on if it's Windows PowerShell,
    PowerShell Core on Windows, or PowerShell Core on macOS/Linux. The easiest way to resolve it
    is to just ask different possible installations of PowerShell where their profiles are.
    r   zsh~z.bash_profilez.bashrc)rl   rQ   r   rW   rm   ZDOTDIRz$ZDOTDIRz.zshrcz/etc/profile.d/conda.sh)rl   rQ   rW   r   z.configzconfig.fishxonshz.xonshrcz%ALLUSERSPROFILE%xonshrcz/etc/xonshrctcshz.tcshrc
powershellz$PROFILE.CurrentUserAllHostsz$PROFILE.AllUsersAllHostsc               7      K   | D ],  }	 t        |ddf      j                  j                          . y # t        $ r Y ;w xY ww)Nz
-NoProfilez-Command)r0   stdoutstrip	Exception)	exe_namesexe_nameprofiles     rA   find_powershell_pathsz3make_initialize_plan.<locals>.find_powershell_paths  sR     % )!<WEfUUW%
 ! s$   A)6A	AAAApwshzpwsh-previewr   z>HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRunz?HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRunrl   zOHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabledr   Anaconda Prompt.lnkDesktop)rL   setr$   r   r!   r"   r   init_sh_userr9   r\   environinit_sh_systeminit_fish_userinit_xonsh_userinit_powershell_userinit_cmd_exe_registryinit_long_pathinstall_anaconda_promptr4   r3   r   r   )rQ   rc   rd   re   rf   rW   rR   bashrc_path
zshrc_pathconfig_fish_pathconfig_xonsh_pathtcshrc_pathr   config_powershell_pathsconfig_pathdesktop_dir	exceptionr   s                    @rA   r_   r_   "  s   & \*D[FV Sf/YOK KK , 5 5'2(4!'#*	
 F?xBJJ&#DX$>?
#Dh$78
KK , 5 5'1(4!&#*	
 KK . 7 7'@(4#*	 %d3	6=&QRKK . 7 7'7(4#*	 %d3	6=&QRKK . 7 7'7(4#*	 & &tC'< =KK / 8 8'8(4#*	 $*,gyA%! %3!KK / 8 8'8(4#*	 HT#y12(11#.$0#&	
	
 v4G1G	 #&!,G#
 3 	K&$8$A$A+6,8'.#		 FKK 5 > >(5(4#*	
 KK 5 > >(5(4#*	
 KK . 7 7% (7 KK 7 @ @'+(*6K( )5#*	 )89I9I)J&Y$$}":c?I>KK 7 @ @'+K9N'O(4#*	 Kr@   c           	      x   | D ]s  }|j                  dd       }|t        j                  t        j                  fv r8	  t	               |d      |j                  dd      i |j                  di       }||d<   u y # t
        $ r6}t        j                  d|d   |d       t        j                  }Y d }~Bd }~ww xY w)	NrE   rn   argsr?   ro   z%s: %rT)exc_info)	getr7   r=   r>   globalsr   loginfor<   )rR   rI   previous_resultrE   es        rA   rM   rM     s      ((8T2v0@0@AA	'0WYtJ/0&"%)-(B)?F  X   	'HHXtJ/THB&&F	's   6A::	B9,B44B9c                 (   t        d | D              rt        rddlm} d}	 t	        ddd      5 }|j                  t        j                  | dd	 
             |j                  }ddd       dt        t        j                        z  } ||ddd|z  f      \  }}|t        d|z  t        j                         t        |      5 }t        j                  t!        |j#                                     }ddd       |rt%        |      rt'        |       nt        j                  | dd 
      }	t)        dt        j                  z  i t+        j,                         |	      }
|
j                  j/                         }|rt        |t        j                         t        j                  |
j0                  j/                               }| dd= | j3                         yy# 1 sw Y   xxY w# 1 sw Y   xY w# |rt%        |      rt'        |       w w w xY w)a  
    The strategy of this function differs between unix and Windows.  Both strategies use a
    subprocess call, where the subprocess is run with elevated privileges.  The executable
    invoked with the subprocess is `python -m conda.core.initialize`, so see the
    `if __name__ == "__main__"` at the bottom of this module.

    For unix platforms, we convert the plan list to json, and then call this module with
    `sudo python -m conda.core.initialize` while piping the plan json to stdin.  We collect json
    from stdout for the results of the plan execution with elevated privileges.

    For Windows, we create a temporary file that holds the json content of the plan.  The
    subprocess reads the content of the file, modifies the content of the file with updated
    execution status, and then closes the file.  This process then reads the content of that file
    for the individual operation execution results, and then deletes the file.
    c              3   H   K   | ]  }|d    t         j                  k(    ywrD   rF   rG   s     rA   rJ   z$run_plan_elevated.<locals>.<genexpr>7  rY   rK   r   )run_as_adminNzw+z.jsonF)suffixdeletec                     | j                   S N__dict__xs    rA   <lambda>z#run_plan_elevated.<locals>.<lambda>A  s
    

 r@   )ensure_asciidefaultz"%s"z-mzconda.core.initializez)ERROR during elevated execution.
  rc: %srZ   c                     | j                   S r  r  r  s    rA   r  z#run_plan_elevated.<locals>.<lambda>W  s
    1:: r@   z sudo %s -m conda.core.initialize)envpathstdin)rO   r"   common._os.windowsr  r   r   jsondumpsnamer   ra   r   r`   rb   r#   loadsr   readr-   r,   r0   r\   r   r   r   extend)rR   r  	temp_pathtfr   	hinstance
error_coder   _planr   rE   rb   s               rA   r^   r^   '  s     
@4
@@9I%+DO (SUHH

 u>R
 !#I( $gcnn&==
(4'>@RS)%	: )DzQ ZZ
 )_ D JJ'7	'BCED !3)$ JJt%AUVE$2S^^CYY[	F ]]((*Ff3::.JJv}}2245EGE[ A( ($D D !3)$ "49s;   G5 5G&A!G5 -G)4G5 G&!G5 )G2.G5 5Hc                      t         j                  j                         j                         } t	        j
                  |       }t        |       t         j                  j                  t	        j                  |             y r  )
ra   r   r&  r   r"  r%  rM   r   r   r#  )r   rR   s     rA   run_plan_from_stdinr.  g  sK    IINN""$E::eDTNJJTZZ%&r@   c           	      R   t        |       5 }t        j                  t        |j	                                     }d d d        t               t        | d      5 }|j                  t        t        j                  |d                   d d d        y # 1 sw Y   YxY w# 1 sw Y   y xY w)Nzw+bF)r  )	r#   r"  r%  r   r&  rM   r   r   r#  )r(  r   rR   s      rA   run_plan_from_temp_filer0  n  s    	i 7Bzz*2779567TN	i	 F2
tzz$UCDEF F7 7F Fs   -B0BBB&c                     |st         j                  }| D ])  }t        |j                  d      d|d   d   |       + t	        d | D              }|rt        d|       y t        d|       y )	NrE   14ro   rl   rZ   c              3   `   K   | ]&  }|j                  d       t        j                  k(   ( ywrD   )r	  r7   r=   rG   s     rA   rJ   z%print_plan_results.<locals>.<genexpr>~  s"     ID$((8$7Is   ,.zK
==> For changes to take effect, close and re-open your current shell. <==
zNo action taken.)ra   r   r`   r	  rO   )rR   streamrI   changeds       rA   rP   rP   v  sr     
(+T(^M-JKRX	


 IDIIG[	

 	 v.r@   c                    | }t        |      r%t        |      5 }|j                         }d d d        nd}t        rd}n!t	        |t                     }t        |d      }t        d      }	|t        d      |dk(  r|	nd||dz  z  }|k7  rt        j                  r+t        d       t        |        t        t        ||             t        j                  sKt        t        |             t        |d	      5 }
|
j                  |       d d d        t        st!        |       t"        j$                  S t"        j&                  S # 1 sw Y   xY w# 1 sw Y   GxY w)
Nr   T)with_usr_bin_enva  
    # Before any more imports, leave cwd out of sys.path for internal 'conda shell.*' commands.
    # see https://github.com/conda/conda/issues/6549
    if len(sys.argv) > 1 and sys.argv[1].startswith('shell.') and sys.path and sys.path[0] == '':
        # The standard first entry in sys.path is an empty string,
        # and os.path.abspath('') expands to os.getcwd().
        del sys.path[0]
    z
    # -*- coding: utf-8 -*-
    import sys
    %(extra)s
    if __name__ == '__main__':
        from %(module)s import %(func)s
        sys.exit(%(func)s())
    r   )extrar   r   r   r   )r   r#   r&  r"   r   r&   r2   r   r   r   r`   	make_diffrN   r+   r
   r   r.   r7   r=   r>   )rl   rQ   r   r   conda_ep_pathr   original_ep_contentnew_ep_contentpython_pathconda_extrafdsts              rA   r   r     sL     Mm-  	,B"$'')	, 	, !<)>)@A9$
 		K d		 !'+ 52	 N ,,??$K+)/@AGM*+mS) +T

>*+.k	, 	,^+ +s   E6EEEc                 n   | }dt        j                  d      z  }t        t        dd|z        }t	        |      r)t        |d      t        |d      k(  rt        j                  S t        j                  s4t        t        |            st        t        |             t        ||       t        j                  S )N   Pr   z
cli-%d.exemd5)structcalcsizer   r   r   r/   r7   r>   r   rN   r   r
   r+   r*   r=   )rl   rQ   exe_pathbitssource_exe_paths        rA   r   r     s    Hvs##D-wt8KLOhx';+NN###??WX&'GH%& 	_h'??r@   c           
         t        t        dd      }t        t        j                  d   dd      }ddj	                  t        |dd	      t        |dd
            f}t
        j                  }t        j                  sAt        ddd| z   dj                  |      dt        d      z   d|z          t
        j                  }|rDt        j                  j                  |      r%t        j                  |       t
        j                  }|S )Nr   zconda_icon.icoHOMEPATHr   r   z/Kz""{}" && "{}""r   r   r   z%windir%\System32\cmd.exezAnconda Promptr    r   )r   r   r\   r   formatr7   r>   r   rN   r5   r   r=   r  r   remove)rl   rQ   rW   	icon_pathtargetr  rE   s          rA   r   r     s     '2BCI"**Z()5JKF 	z+;<z+DE	
D F??)HHTNC N	
 77>>&!IIf__FMr@   c                 ,   t        |       r%t        |       5 }|j                         }d d d        nd}|}|k7  rt        j                  r+t        d       t        |        t        t        ||             t        j                  sJt        t        |              t        | d      5 }|j                  |       d d d        t        j                  S t        j                  S t        j                  S # 1 sw Y   xY w# 1 sw Y   t        j                  S xY w)Nr   r   r   )r   r#   r&  r   r   r`   r9  rN   r+   r
   r   r7   r=   r>   )rl   file_contentr   original_contentnew_contentr?  s         rA   _install_filerT    s    k+ 	)"!wwy	) 	) K&&??$K+),k:;GK()k3' (4

;'(v%	) 	)(s   C/%C;/C8;Dc                 N    t               j                  d      }t        | |      S NF)r   )r   hookrT  rl   rQ   rQ  s      rA   r   r     %    !#((E(BLl33r@   c                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r   r   r#   r&  rT  rl   rQ   src_pathfsrcrQ  s        rA   r   r     sI    &NKH	h #4yy{#l33# #   AAc                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r[  r\  s        rA   r   r   $  sI    &^LH	h #4yy{#l33# #r_  c                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r[  r\  s        rA   r   r   ,  sJ    &=MNH	h #4yy{#l33# #r_  c                     t        t        ddd      }d|z  }t        |      5 }||j                         z  }d d d        t	        | |      S # 1 sw Y   xY w)Nr   r   r   #!/bin/sh
_CONDA_ROOT="%s"
r[  rl   rQ   r]  rQ  r^  s        rA   r   r   4  sX    &
CH2\AL	h $4		#$l33$ $   AAc                     t        t        ddd      }d|z  }t        |      5 }||j                         z  }d d d        t	        | |      S # 1 sw Y   xY w)Nr   r   r   rc  r[  rd  s        rA   r   r   =  sX    &EH2\AL	h $4		#$l33$ $re  c                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r[  rl   rQ   conda_bat_src_pathr^  rQ  s        rA   r   r   F  sL    0':{S	 	! #Tyy{#l33# #r_  c                     t        t        dddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r   r[  rh  s        rA   r   r   N  sR    GY{ 
 	! #Tyy{#l33# #s   AAc                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r[  rh  s        rA   r   r   X  sQ    GZ1F 
 	! #Tyy{#l33# #r_  c                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r[  rh  s        rA   r   r   b  M    0':GWX	 	! #Tyy{#l33# #r_  c                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r[  rh  s        rA   r   r   j  sQ    GZ1J 
 	! #Tyy{#l33# #r_  c                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r[  rh  s        rA   r   r   t  rm  r_  c                 N    t               j                  d      }t        | |      S rV  )r   rW  rT  rX  s      rA   r   r   |  s$     ?''5'ALl33r@   c                     t        t        ddd      }t        |      5 }|j                         }d d d        t	        |       S # 1 sw Y   xY w)Nr   r   r   r[  )rl   rQ   conda_psm1_pathr^  rQ  s        rA   r   r     sJ    -w
LQO	o	 #$yy{#l33# #r_  c                 N    t               j                  d      }t        | |      S rV  )r   rW  rT  rX  s      rA   r   r     s%    &(---GLl33r@   c                 N    t               j                  d      }t        | |      S rV  )r   rW  rT  rX  s      rA   r   r     rY  r@   c                 N    t               j                  d      }t        | |      S rV  )r   rW  rT  rX  s      rA   r   r     s$    >&&%&@Ll33r@   c                     t         rddlm}  |t        | dd            }nt        | dd      }t	        d      || dz  }|S )	Nr   native_path_to_unixr   r   r   rk   a  
        # >>> conda initialize >>>
        # !! Contents within this block are managed by 'conda init' !!
        if test -f %(conda_exe)s
            eval %(conda_exe)s "shell.fish" "hook" $argv | source
        else
            if test -f "%(conda_prefix)s/etc/fish/conf.d/conda.fish"
                . "%(conda_prefix)s/etc/fish/conf.d/conda.fish"
            else
                set -x PATH "%(conda_prefix)s/bin" $PATH
            end
        end
        # <<< conda initialize <<<
        )	conda_exerQ   )r"   r   rx  r   r   rQ   rx  ry  conda_initialize_contents       rA   _config_fish_contentr|    sS    2'\9k(RS	ug6	#	   $	 & $#r@   c                    | }	 t        |      5 }|j                         }d d d        }d}t        |      }|rjt	        j
                  d| d|t        j                        }t	        j
                  dt        z   d|t        j                  t        j                  z        }nt        s6t	        j
                  dt        |      z  d| |t        j                        }t	        j
                  d	d| d
| |t        j                        }t	        j
                  dd| |t        j                        }d}	t	        j
                  t        |	|t        j                        }|j                  |	|      }d|vr|d|z  z  }||k7  rt        j                  r+t        d       t        |        t        t        ||             t        j                   s^t#        t%        |            st'        t%        |             t        |d      5 }|j)                  |       d d d        t*        j,                  S t*        j,                  S t*        j.                  S # 1 sw Y   1xY w# t        $ r d}Y B  xY w# 1 sw Y   t*        j,                  S xY w)Nr   ## commented out by conda initialize#\s(.*?)\s*\1flags^\s*z:^[ \t]*?(set -gx PATH ([\'\"]?).*?%s\/bin\2 [^\n]*?\$PATH)# \1  z^^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*etc\/fish\/conf\.d\/conda\.fish.*?)\n(conda activate.*?)$\n# \2  zJ^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*etc\/fish\/conda\.d\/conda\.fish.*?)$__CONDA_REPLACE_ME_123__# >>> conda initialize >>>
%s
r   r   )r#   r&  FileNotFoundErrorr|  resub	MULTILINECONDA_INITIALIZE_RE_BLOCKDOTALLr"   r	   replacer   r   r`   r9  rN   r   r
   r+   r   r7   r=   r>   
rl   rQ   rW   user_rc_pathr   
rc_contentrc_original_contentconda_init_commentr{  replace_strs
             rA   r   r     sJ   L, 	#2J	# %>3LAVV-./,,	

 VV//))bll*	

 |,-,-.llJ VV$()2D1EF,,

 VVY()*,,	

 1VV%,,	

  ''5MN
'z9(%===J((??$K+)/<=',/0-.lC( %B$%v[	# 	# 
H%s3   I II I/II I,*I,/Jc                     t         rddlm}  |t        | dd            }nt        | dd      }t	        d      j                  |      }|S )	Nr   rw  r   r   r   rk   a~  
    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    if !(test -f "{conda_exe}"):
        import sys as _sys
        from types import ModuleType as _ModuleType
        _mod = _ModuleType("xontrib.conda",
                        "Autogenerated from $({conda_exe} shell.xonsh hook)")
        __xonsh__.execer.exec($("{conda_exe}" "shell.xonsh" "hook"),
                            glbs=_mod.__dict__,
                            filename="$({conda_exe} shell.xonsh hook)")
        _sys.modules["xontrib.conda"] = _mod
        del _sys, _mod, _ModuleType
    # <<< conda initialize <<<
    )ry  )r"   r   rx  r   r   rL  rz  s       rA   _config_xonsh_contentr    sQ    2'\9k(RS	ug6	#	   fyf!! " $#r@   c                    | }	 t        |      5 }|j                         }d d d        }d}t        |      }|rjt	        j
                  d| d|t        j                        }t	        j
                  dt        z   d|t        j                  t        j                  z        }nLd}	t	        j
                  t        |	|t        j                        }|j                  |	|      }d|vr	|d	| d	z  }||k7  rt        j                  r+t        d	       t        |        t        t        ||             t        j                  s^t        t!        |            st#        t!        |             t        |d
      5 }|j%                  |       d d d        t&        j(                  S t&        j(                  S t&        j*                  S # 1 sw Y   xY w# t        $ r d}Y   xY w# 1 sw Y   t&        j(                  S xY w)Nr   r~  r  r  r  r  r  r  r   r   )r#   r&  r  r  r  r  r  r  r  r  r   r   r`   r9  rN   r   r
   r+   r   r7   r=   r>   r  s
             rA   r   r   )  s   L, 	#2J	# %>4\BVV-./,,	

 VV//))bll*	

 1VV%,,	

  ''5MN
'z9B78;;J((??$K+)/<=',/0-.lC( %B$%vm	# 	# 
Z%s3   G
 F=G
 3G=GG
 
GGG5c                     t         r,ddlm}  |t        | dd            }t	        d      ||dz  }|S t        | dd      }|d	v rt	        d
      ||t        |      | dz  }|S t	        d      ||t        |      | dz  }|S )Nr   rw  r   r   a  
        # >>> conda initialize >>>
        # !! Contents within this block are managed by 'conda init' !!
        if [ -f '%(conda_exe)s' ]; then
            eval "$('%(conda_exe)s' 'shell.%(shell)s' 'hook')"
        fi
        # <<< conda initialize <<<
        )ry  r   r   rk   )cshr   a  
            # >>> conda initialize >>>
            # !! Contents within this block are managed by 'conda init' !!
            if ( -f "%(conda_prefix)s/etc/profile.d/conda.csh" ) then
                source "%(conda_prefix)s/etc/profile.d/conda.csh"
            else
                setenv PATH "%(conda_bin)s:$PATH"
            endif
            # <<< conda initialize <<<
            )ry  r   	conda_binrQ   ak  
            # >>> conda initialize >>>
            # !! Contents within this block are managed by 'conda init' !!
            __conda_setup="$('%(conda_exe)s' 'shell.%(shell)s' 'hook' 2> /dev/null)"
            if [ $? -eq 0 ]; then
                eval "$__conda_setup"
            else
                if [ -f "%(conda_prefix)s/etc/profile.d/conda.sh" ]; then
                    . "%(conda_prefix)s/etc/profile.d/conda.sh"
                else
                    export PATH="%(conda_bin)s:$PATH"
                fi
            fi
            unset __conda_setup
            # <<< conda initialize <<<
            )r"   r   rx  r   r   r
   )rQ   r   rx  ry  r{  s        rA   _bashrc_contentr  g  s    2'\9k(RS	#'	$
 #
$
 r $#W ug6	O#'+	( '$Y/ ,	($R $#/ (,($ '$Y/ ,	#($. $#r@   c                 r   | }	 t        |      5 }|j                         }d d d        }t        ||      }d}	|rkt	        j
                  d|	 d|t        j                        }t	        j
                  dt        z   d|t        j                  t        j                  z        }n3t        s6t	        j
                  dt        |      z  d|	 |t        j                        }t	        j
                  d	d|	 d
|	 |t        j                        }t	        j
                  dd|	 |t        j                        }t        r(t	        j
                  dd|t        j                        }n't	        j
                  dd|t        j                        }d}
t	        j
                  t        |
|t        j                        }|j                  |
|      }d|vr|d|z  z  }||k7  rt        j                  r+t        d       t        |        t        t        ||             t        j                   s6t        |d      5 }|j#                  |       d d d        t$        j&                  S t$        j&                  S t$        j(                  S # 1 sw Y   `xY w# t        $ r d}Y q  xY w# 1 sw Y   t$        j&                  S xY w)Nr   r~  r  r  r  r  z3^[ \t]*?(export PATH=[\'\"].*?%s\/bin:\$PATH[\'\"])r  zY^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*etc\/profile\.d\/conda\.sh.*?)\n(conda activate.*?)$r  zD^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*etc\/profile\.d\/conda\.sh.*?)$zE^[ \t]*^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*Scripts[/\\]activate.*?)$z)# \1  # commented out by conda initializez=^[ \t]*^[ \t]*[^#\n]?[ \t]*((?:source|\.) .*bin/activate.*?)$r  r  r  r   r   )r#   r&  r  r  r  r  r  r  r  r"   r	   r  r   r   r`   r9  rN   r   r7   r=   r>   )rl   rQ   r   rW   r  r   r  r  r{  r  r  s              rA   r   r     su   L, 	#2J	# %.|UC>VV-./,,	

 VV//))bll*	

 |,-,-.llJ VV$()2D1EF,,

 VVS()*,,	

 X<ll	J P<ll	J 1VV%,,	

  ''5MN
'z9(%===J((??$K+)/<=lC( %B$%vu	# 	# 
b%s3   J I>J 4J>JJ JJJ6c                    | }t        |      r%t        |      5 }|j                         }d d d        nd}|r@t        |      r%t        j                  |       t
        j                  S t
        j$                  S t        |d      }|k7  rt        j                  r+t        d       t        |        t        t        ||             t        j                  s`t        |      rt        |       t        t!        |             t        |d      5 }|j#                  |       d d d        t
        j                  S t
        j                  S t
        j$                  S # 1 sw Y   (xY w# 1 sw Y   t
        j                  S xY w)Nr   posixr   r   )r   r#   r&  r\   rM  r7   r=   r  r   r   r`   r9  rN   r-   r,   r+   r
   r   r>   )rl   rQ   rW   conda_sh_system_pathr   conda_sh_system_contentsconda_sh_contentss          rA   r   r   
  s4   &"#&' 	12')wwy$	1 	1 $& &'II*+??"  ,L'B#'88dk"i 13KLM??/0./ 456.4 0HH./0??"6??"-	1 	1&0??"s   E	E E E8c                 r   | j                  dd      \  }}|j                  dd      \  }}t        t        |      }	 t        j                  ||dt        j
                        }	 t        j                  ||      }|d   }t        |t              r|j                         }|d   }	||	ft        j                  |       S # t        $ r}|j                  t        k7  r Y d }~yd }~ww xY w# t        $ r- t        j                  |       Y t        j                  |       yw xY w# t        j                  |       w xY w)N\r1   r   NN)splitrsplitgetattrwinregOpenKeyKEY_READr   errnor   QueryValueEx
isinstancestrr   CloseKeyr   )
rl   main_keythe_rest
subkey_str
value_namekeyr  value_tuplevalue_value
value_types
             rA   _read_windows_registryr  (  s    %**43Hh%__T15J
vx(HnnXz1fooF))#z:!!nk3'%++-K ^
J& 	#  77f  
 	s<   &B< #AC& <	C#CC#&DD DD D6c                    | j                  dd      \  }}|j                  dd      \  }}t        t        |      }	 t        j                  ||dt        j
                        }	 t        j                  ||d||       t        j                  |       y # t        $ r4}|j                  t        k7  r t        j                  ||      }Y d }~hd }~ww xY w# t        j                  |       w xY w)Nr  r1   r   )r  r  r  r  r  	KEY_WRITEr   r  r   	CreateKey
SetValueExr  )	rl   r  r  r  r  r  r  r  r  s	            rA   _write_windows_registryr  F  s    $**43Hh%__T15J
vx(H5nnXz1f6F6FG
#z1j+F  577fx45 	s#   &B #C 	C*C

CC)c                    t        |       \  }}|d}t        j                  }dj                  t	        |dd            }d| d| }|rg|j                  d      }|D cg c]  }||vs|j                          }}|D cg c]  }||vs|j                          }}dj	                  |      }	nd	}
t        j                  d
|
|dt        j                  t        j                  z        }	t        j                  d|
|	t        j                  t        j                  z        }	|	j                  |
dz   |
z   |
      }||	k7  r |}	|	j                  |
dz   |
z   |
      }||	k7  r |j                  |
|      }	||	vr|	r	|	d|z   z  }	n|}	||	k7  rht        j                  r+t        d       t        |        t        t        ||	             t        j                   st#        | |	|       t$        j&                  S t$        j(                  S c c}w c c}w )Nr   z"{}"r   r   z	if exist rK  &z & r  zF(if exist \"[^\"]*?conda[-_]hook\.bat\" \"[^\"]*?conda[-_]hook\.bat\")r1   countr  z(\"[^\"]*?conda[-_]hook\.bat\")r  r   )r  r  REG_EXPAND_SZrL  r   r  r   r  r  
IGNORECASEUNICODEr  r   r   r`   r9  rN   r  r7   r=   r>   )rl   rQ   rW   
prev_valuer  old_hook_pathnew_hookautorun_partspart	new_valuer  new_value_2s               rA   r   r   V  s    4K@J

))
MM$|ZAQ"RSM=/=/:H #((-2?X$8SWCWXX &3
!m46ODJJL
 
 JJ}-	0FFU--"**,
	 FF.--"**,	
	  ''e(;k(I;WY&#I#++e#k1;K Y&
  ''X>	9$UX--	$	Y??$K+)J	23#KJG_ Y
s   	H (H  	H
Hc                 J   t         j                  d   j                  d      \  }}}t        |      dk\  rt        |      dk\  rt	        |       \  }}t        |      dk7  rt         j                  r4t        d       t        |        t        t        t        |      d             t         j                  st        | dt        j                         t        j                  S t        j                  S t         j                  r&t        d       t        d       t        j                  S y )Nr1   .
   i8  1r   zyNot setting long path registry key; Windows version must be at least 10 with the fall 2016 "Anniversary update" or newer.)r   os_distribution_name_versionr  intr  r  r   r`   r9  rN   r  r  	REG_DWORDr7   r=   r>   )rl   win_ver_win_revr  r  s         rA   r   r     s    !>>qAGGLGQ
7|rc'le3!7!D
Jz?c!dk"iJ56??'Q8H8HI??"###??$K? ### r@   c                 l    t         rt        | dd      }nt        | dd      }t        d| d| d      }|S )Nr   r   r   rk   zt
    #region conda initialize
    # !! Contents within this block are managed by 'conda init' !!
    If (Test-Path "z") {
        (& "z_" "shell.powershell" "hook") | Out-String | ?{$_} | Invoke-Expression
    }
    #endregion
    )r"   r   r   )rQ   ry  conda_powershell_modules      rA   _powershell_profile_contentr    sT    y+>	ug6	" ; K 			 #"r@   c                    | }t         j                  j                  |      r%t        |      5 }|j	                         }d d d        nd}}|r>t        j                  t        d|dt
        j                  t
        j                  z        }nft        |      }d|vr
|d| dz  }nMt        j                  t        d|dt
        j                  t
        j                  z        j                  d|      }||k7  rt        j                  r+t        d       t        |        t        t        ||             t        j                   s^t        t#        |            st%        t#        |             t        |d      5 }|j'                  |       d d d        t(        j*                  S t(        j*                  S t(        j,                  S # 1 sw Y   xY w# 1 sw Y   t(        j*                  S xY w)Nr   r1   r  z#region conda initializer   r  r   )r\   r  r   r#   r&  r  r  CONDA_INITIALIZE_PS_RE_BLOCKr  r  r  r  r   r   r`   r9  rN   r
   r+   r   r7   r=   r>   )rl   rQ   rW   profile_pathfpprofile_contentprofile_original_contentr{  s           rA   r   r     s   L 
ww~~l#, 	(2 ggiO	( 	( . &&())bll*
 $?|#L %_<$<#=R@@O ff,*ii",,. g02JK  22??$K+)4oFG',/0-.lC( *B)*v[	( 	(R*s   F?5G?G	G$c           
      f   d}| }t        j                  t        t        |d            t        t        |d            t        t        |d            f      }d |D        }|D ]Q  }t	        dt        ||      z  t
        j                         t        j                  st        t        ||             d}S d	}|D ]U  }t        ||      }t        |      st	        d|z  t
        j                         t        j                  st        |       d}W |rt        j                  S t        j                  S )
NFzconda-*infozconda.*zconda-*.eggc              3   D   K   | ]  }|j                  d       r|  yw)rp   Nendswith)rH   ps     rA   rJ   z)remove_conda_in_sp_dir.<locals>.<genexpr>  s     N<L1M1Ns     z	rm -rf %srZ   T)rk   	conda_env)r   from_iterabler   r   r`   ra   rb   r   rN   r,   r-   r7   r=   r>   )rl   r8   r   rm_rf_thesefnothersotherr  s           rA   r   r     s   H#%%'78'34'78	
K OkNK kD!2B77cjjI$("-.	
F  %u-4=+$3::6??dH r@   c                    |t         j                  z   }t        |       r&t        | d      5 }|j	                         }d d d        nd}|k7  rt
        j                  r[t        dt        j                         t        | t        j                         t        t        ||      t        j                         t
        j                  s?t        | d      5 }|j                  t        |             d d d        t        j                  S t        j                  S t        j                   S # 1 sw Y   xY w# 1 sw Y   t        j                  S xY w)Nrbr   r   rZ   wb)r\   linesepr   r#   r&  r   r   r`   ra   rb   r9  rN   r   r    r7   r=   r>   )rl   rq   conda_egg_link_contentsr   conda_egg_link_contents_olds        rA   r   r     s    /"**<k+t$ 	4*,'')'	4 	4 ')#"&==??$SZZ(+CJJ/57NOZZ k4( HB-.EFGHv%	4 	4Hs   D&D2&D/2E
c                 n   |}t        |       r%t        |       5 }|j                         }d d d        nd}j                         }||v rt        j
                  S t        j                  dz   t        fd|D              }|t        j                  z   t        j                  j                  |      z   t        j                  z   }t        j                  r[t        dt        j                         t        | t        j                         t        t!        ||      t        j                         t        j"                  s?t        | d      5 }|j%                  t'        |             d d d        t        j(                  S t        j(                  S # 1 sw Y   cxY w# 1 sw Y   t        j(                  S xY w)Nr   rk   c              3   F   K   | ]  }|j                        r|  y wr  r  )rH   lnln_ends     rA   rJ   z*modify_easy_install_pth.<locals>.<genexpr>G  s!      r{{6/Bs   !!r   rZ   r  )r   r#   r&  
splitlinesr7   r>   r\   septupler  r   r   r   r`   ra   rb   r9  rN   r   r    r=   )rl   rq   easy_install_new_liner   old_contentsold_contents_linesnew_contentsr  s          @rA   r   r   8  sW   -k+ 	%"779L	% 	% %002 22VVgF '  	
**	
**//,
-	. **	  d$k

+il3#**E??+t$ 	9HH),78	9??6??7	% 	%2	9??s   FFFF4c                    t        |       r%t        |       5 }|j                         }d d d        nd}t        d      t        z  }|k(  rt
        j                  S t        j                  r[t        dt        j                         t        | t        j                         t        t        ||      t        j                         t        j                  sLt        |       rt        |        t        | d      5 }|j!                  |       d d d        t
        j"                  S t
        j"                  S # 1 sw Y   xY w# 1 sw Y   t
        j"                  S xY w)Nr   z
    Metadata-Version: 1.1
    Name: conda
    Version: %s
    Platform: UNKNOWN
    Summary: OS-agnostic, system-level binary package manager.
    r   rZ   r   )r   r#   r&  r   CONDA_VERSIONr7   r>   r   r   r`   ra   rb   r9  rN   r-   r,   r   r=   )rl   r   r  r  s       rA   r   r   [  s
    k+ 	%"779L	% 	%  		
 		  |#d$k

+il3#**E??;++s# 	#rHH\"	#??6??=	% 	%8	#??s   D17D>1D;>Ec                 p    dj                  t        | j                         |j                                     S )Nr   )r   r   r  )oldnews     rA   r9  r9    s&    99\#.."2CNN4DEFFr@   c                 b   t        | t                     }t        d|z        }|j                  j	                         |j
                  j	                         }}|r|j                         d   }n!|r|j                         d   }nt        d      t        | t        t        |                  }|||fS )Nz%s --versionr1   z(No python version information available.)
r   r&   r0   r   r   rb   r  
ValueErrorr(   r'   )r   r   rE   r   rb   r   r   s          rA   r   r     s    f356J^j89F]]((*FMM,?,?,AFF*	*CDD?OP ~'888r@   __main__)Fr  r  )__doc__r"  r\   r  rD  ra   difflibr   r  r   r   	itertoolsr   loggingr   os.pathr   r	   r
   r   r   r   r   r   pathlibr   randomr   r   r   r   r   r  r   r   r   r   r   r   auxlib.compatr   
auxlib.ishr   base.contextr   common.compatr   r   r    r!   r"   r#   common.pathr$   r%   r&   r'   r(   
exceptionsr)   gateways.disk.creater*   r+   gateways.disk.deleter,   gateways.disk.linkr-   gateways.disk.permissionsr.   gateways.disk.readr/   gateways.subprocessr0   portabilityr2   r  menuinst.knownfoldersr3   r4   menuinst.winshortcutr5   r9   r  r  r  r7   rS   ri   r   r   r   rL   r_   rM   r^   r.  r0  rP   r   r   r   rT  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r|  r   r  r   r  r   r   r  r  r   r   r  r   r   r   r   r   r9  r   argvr(  r?   r@   rA   <module>r     s  :  	 	  
       W W W   - +  3  "   ) 0 ( ( 7 , 1 9	 @4 .  L 
  JO2Zz+&=@z| JOnl =@'F/.; |$D .44444444444444444$:R j$6; |>$B_ D<< ? D$2#(4 n D 4 F"TG9" zHHQK		* r@   