Your IP : 216.73.216.213
�
e fM � @ s� d Z d d l Z d d l Z d d l Z d d l Z e j Z d Z d Z d Z d d � Z
d d � Z e d
k r e � n d S)a Add Python to the search path on Windows
This is a simple script to add Python to the Windows search path. It
modifies the current user (HKCU) tree of the registry.
Copyright (c) 2008 by Christian Heimes <christian@cheimes.de>
Licensed to PSF under a Contributor Agreement.
� NZEnvironment�PATHz%PATH%c C sh t j j t j j t j � � } t j j | d � } t j d } t t d � r t j
j | d � } t j j | d � } n d } t j
t t � �� } y t j | t � d } Wn t k
r� t } Yn X| g } xK | | | f D]: } | r� | | k r� t j j | � r� | j | � q� q� Wt j j | � } t j | t d t j | � | | f SWd QXd S)NZScripts�APPDATA� USER_SITEz %APPDATA%r )�os�path�dirname�normpath�sys�
executable�join�environ�hasattr�siter �replace�winregZ CreateKey�HKCU�ENVZQueryValueExr �OSError�DEFAULT�isdir�append�pathsepZ
SetValueExZ
REG_EXPAND_SZ) Z
pythonpath�scriptsZappdataZuserpathZuserscripts�key�envpath�pathsr � r �?/opt/alt/python34/lib64/python3.4/Tools/scripts/win_add2path.py�modify s&