Your IP : 216.73.216.213


Current Path : /opt/alt/alt-nodejs9/root/lib/python2.7/site-packages/gyp/
Upload File :
Current File : //opt/alt/alt-nodejs9/root/lib/python2.7/site-packages/gyp/MSVSVersion.pyo

�
 Qc@s�dZddlZddlZddlZddlZddlZddlZdefd��YZd�Z	dd�Zd�Zd�Z
ed	�Zd
�Zd�Zdd
�ZdS(s3Handle version information related to Visual Stuio.i����NtVisualStudioVersioncBs}eZdZd
d�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�ZRS(s1Information regarding a version of Visual Studio.c

CsU||_||_||_||_||_||_||_||_|	|_dS(N(	t
short_nametdescriptiontsolution_versiontproject_versiontflat_slntuses_vcxprojtpatht	sdk_basedtdefault_toolset(
tselfRRRRRRRRR	((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt__init__s								cCs|jS(N(R(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt	ShortNamescCs|jS(s(Get the full description of the version.(R(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytDescription"scCs|jS(s(Get the version number of the sln files.(R(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytSolutionVersion&scCs|jS(s6Get the version number of the vcproj or vcxproj files.(R(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytProjectVersion*scCs|jS(N(R(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytFlatSolution.scCs|jS(s1Returns true if this version uses a vcxproj file.(R(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytUsesVcxproj1scCs|jrdpdS(s+Returns the file extension for the project.s.vcxprojs.vcproj(R(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytProjectExtension5scCs|jS(s/Returns the path to Visual Studio installation.(R(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytPath9scCs%tjjtjj|jd|��S(s+Returns the path to a given compiler tool. sVC/bin(tosRtnormpathtjoin(R
ttool((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytToolPath=scCs|jS(s\Returns the msbuild toolset version that will be used in the absence
    of a user override.(R	(R
((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytDefaultToolsetAscCs�tjjd�}|jrJ|rJtjjtjj|d��d|gS|dkr{tjjtjj|jd��gSd}tjjd�dks�tjjd	�dkr�d
}ntjjtjj|jd��|gSdS(
sLReturns a command (with arguments) to be used to set up the
    environment.t
WindowsSDKDirsBin/SetEnv.Cmdt/tx86sCommon7/Tools/vsvars32.batt	x86_amd64tPROCESSOR_ARCHITECTUREtAMD64tPROCESSOR_ARCHITEW6432tamd64sVC/vcvarsall.batN(RtenvirontgetRRRR(R
ttarget_archtsdk_dirtarg((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytSetupScriptFs			N(t__name__t
__module__t__doc__tNoneRRR
RRRRRRRRR'(((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyRs										cCs�tjdkrdStjjtjjdd�|d�d|g}|r_|jd|g�nt	j
|dt	jd	t	j�}|j�d
}|j
r�dS|S(
s�Use reg.exe to read a particular key.

  While ideally we might use the win32 module, we would like gyp to be
  python neutral, so for instance cygwin python lacks this module.

  Arguments:
    sysdir: The system subdirectory to attempt to launch reg.exe from.
    key: The registry key to read from.
    value: The particular value to read.
  Return:
    stdout from reg.exe, or None for failure.
  twin32tcygwintWINDIRtsreg.exetquerys/vtstdouttstderri(R,R-N(tsystplatformR+RRRR"R#textendt
subprocesstPopentPIPEtcommunicatet
returncode(tsysdirtkeytvaluetcmdtpttext((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt_RegistryQueryBasecs$!	cCs`d}ytd||�}Wn=tk
r[}|jtjkrUtd||�}q\�nX|S(s�Use reg.exe to read a particular key through _RegistryQueryBase.

  First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If
  that fails, it falls back to System32.  Sysnative is available on Vista and
  up and available on Windows Server 2003 and XP through KB patch 942589. Note
  that Sysnative will always fail if using 64-bit python due to it being a
  virtual directory and System32 will work correctly in the first place.

  KB 942589 - http://support.microsoft.com/kb/942589/en-us.

  Arguments:
    key: The registry key.
    value: The particular registry value to read (optional).
  Return:
    stdout from reg.exe, or None for failure.
  t	SysnativetSystem32N(R+RAtOSErrorterrnotENOENT(R<R=R@te((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt_RegistryQuery�scCsBt||�}|sdStjd|�}|s5dS|jd�S(s�Use reg.exe to obtain the value of a registry key.

  Args:
    key: The registry key.
    value: The particular registry value to read.
  Return:
    contents of the registry key's value, or None on failure.
  sREG_\w+\s+([^\r]+)\r\niN(RHR+tretsearchtgroup(R<R=R@tmatch((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt_RegistryGetValue�s	cCst|�stStS(sxUse reg.exe to see if a key exists.

  Args:
    key: The registry key to check.
  Return:
    True if the key exists
  (RHtFalsetTrue(R<((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt_RegistryKeyExists�scCs�|rtjj|�}nitdddddddtdtd	|d
|dd�d6td
ddddddtdtd	|d
|dd�d
6tdddddddtdtd	|d
|�d6tdddddddtdtd	|d
|�d6tdddddddtdtd	|d
|�d6tdddddddtdtd	|d
|�d6tdddddddtdtd	|d
|�d6tdddddddtdtd	|d
|�d6}|t|�S(sSets up MSVS project generation.

  Setup is based off the GYP_MSVS_VERSION environment variable or whatever is
  autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
  passed in that doesn't match a value in versions python will throw a error.
  t2012sVisual Studio 2012Rs12.00Rs4.0RRRRR	tv110t2012et2010sVisual Studio 2010s11.00t2010et2008sVisual Studio 2008s10.00s9.00t2008et2005sVisual Studio 2005s8.00t2005e(RRRRRNROtstr(tnameRRtversions((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt_CreateVersion�s�







cCsJtjdkrFtjd|gdtj�}|j�dj�}n|S(s.Convert to cygwin path if we are using cygwin.R-tcygpathR1i(R3R4R6R7R8R9tstrip(RR?((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt_ConvertToCygpathsc
	Cs�idd6dd6dd6dd6}g}x�|D]�}d	|d
|d|d|g}x�tt|��D]�}t||d
�}|s�qjnt|�}tjj|d�}tjj|d�}	|r
tjj|�r
|jt	||tjj|dd���qjtjj|	�rj|jt	||dtjj|dd���qjqjWddg}xxtt|��D]d}t|||�}|s�qunt|�}|jt	||dtjj|d�dt
��quWq/W|S(sCollect the list of installed visual studio versions.

  Returns:
    A list of visual studio versions installed in descending order of
    usage preference.
    Base this on the registry and a quick check if devenv.exe exists.
    Only versions 8-10 are considered.
    Possibilities are:
      2005(e) - Visual Studio 2005 (8)
      2008(e) - Visual Studio 2008 (9)
      2010(e) - Visual Studio 2010 (10)
      2012(e) - Visual Studio 2012 (11)
    Where (e) is e for express editions of MSVS and blank otherwise.
  RXs8.0RVs9.0RTs10.0RQs11.0s'HKLM\Software\Microsoft\VisualStudio\%ss3HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%ss$HKLM\Software\Microsoft\VCExpress\%ss0HKLM\Software\Wow6432Node\Microsoft\VCExpress\%st
InstallDirs
devenv.exes
vcexpress.exes..RGs,HKLM\Software\Microsoft\VisualStudio\SxS\VC7s8HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7R(trangetlenRMR`RRRtexiststappendR]RO(
tversions_to_checkt
force_expresstversion_to_yearR\tversiontkeystindexRt	full_pathtexpress_path((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt_DetectVisualStudioVersionss>

#	'tautocCs$|dkr$tjjdd�}ni	dd6dd6dd6dd	6dd
6dd6dd6dd
6dd6}tjjd�}|r�tjjd�}|s�d|kr�td��nt||dt�St|�}t||d|k�}|s|dkrtdd�St|d�Sn|dS(s�Select which version of Visual Studio projects to generate.

  Arguments:
    version: Hook to allow caller to force a particular version (vs auto).
  Returns:
    An object representing a visual studio project format version.
  RotGYP_MSVS_VERSIONs10.0s9.0s8.0s11.0RXRYRVRWRTRURQRStGYP_MSVS_OVERRIDE_PATHRGsYGYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be set to an "e" version (e.g. 2010e)Ri(s10.0s9.0s8.0s11.0(s8.0(s8.0(s9.0(s9.0(s10.0(s10.0(s11.0(s11.0N(	RR"R#t
ValueErrorR]RORZRnR+(Ritversion_mapt
override_pathtmsvs_versionR\((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pytSelectVisualStudioVersionPs2	

(R*RERRIR6R3tgyptobjectRRAR+RHRMRPRNR]R`RnRv(((sM//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/MSVSVersion.pyt<module>sT			
P		: