ó fc@s}dZddlZddlZddlZddlZejZdZdZdZ d„Z d„Z e dkrye ƒndS( sAdd 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 Licensed to PSF under a Contributor Agreement. i˙˙˙˙Nt EnvironmenttPATHu%PATH%c Csgtjjtjjtjƒƒ}tjj|dƒ}tjd}tt dƒrt j j |dƒ}tjj|dƒ}nd}t jttƒĘ}yt j|tƒd}Wntk rÍt}nX|g}xK|||fD]:}|rç||krçtjj|ƒrç|j|ƒqçqçWtjj|ƒ}t j|tdt j|ƒ||fSWdQXdS(NtScriptstAPPDATAt USER_SITEs %APPDATA%i(tostpathtdirnametnormpathtsyst executabletjointenvironthasattrtsiteRtreplacetNonet_winregt CreateKeytHKCUtENVt QueryValueExRt WindowsErrortDEFAULTtisdirtappendtpathsept SetValueExt REG_EXPAND_SZ( t pythonpathtscriptstappdatatuserpatht userscriptstkeytenvpathtpathsR((s2/usr/lib64/python2.7/Tools/scripts/win_add2path.pytmodifys&!    $cCs`tƒ\}}t|ƒdkr;dGHdj|dƒGHndGHd|GHdGHtj|ƒGHdS(NisPath(s) added:s sNo path was addeds PATH is now: %s s Expanded:(R%tlenR RtExpandEnvironmentStrings(R$R#((s2/usr/lib64/python2.7/Tools/scripts/win_add2path.pytmain-s t__main__( t__doc__R RRRtHKEY_CURRENT_USERRRRRR%R(t__name__(((s2/usr/lib64/python2.7/Tools/scripts/win_add2path.pyts