File: //lib64/python2.7/Tools/scripts/win_add2path.pyc
�
{�fc           @   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 �  Z
 d �  Z e d k ry e �  n  d S(	   s  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.
i����Nt   Environmentt   PATHu   %PATH%c    	   
   C   sg  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 } n 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(   Nt   Scriptst   APPDATAt	   USER_SITEs	   %APPDATA%i    (   t   ost   patht   dirnamet   normpatht   syst
   executablet   joint   environt   hasattrt   siteR   t   replacet   Nonet   _winregt	   CreateKeyt   HKCUt   ENVt   QueryValueExR   t   WindowsErrort   DEFAULTt   isdirt   appendt   pathsept
   SetValueExt
   REG_EXPAND_SZ(	   t
   pythonpatht   scriptst   appdatat   userpatht   userscriptst   keyt   envpatht   pathsR   (    (    s2   /usr/lib64/python2.7/Tools/scripts/win_add2path.pyt   modify   s&