Your IP : 3.137.174.253


Current Path : /opt/alt/alt-nodejs6/root/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/
Upload File :
Current File : //opt/alt/alt-nodejs6/root/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.pyc

�
�Rac@s�dZddlZddlZddlZddlZddlZddlZddlZdefd��YZ	d�Z
dd�Zd�Z
d�Zed	�Zd
�Zd�Zded
�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-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt__init__s								cCs|jS(N(R(R
((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt	ShortName scCs|jS(s(Get the full description of the version.(R(R
((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytDescription#scCs|jS(s(Get the version number of the sln files.(R(R
((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytSolutionVersion'scCs|jS(s6Get the version number of the vcproj or vcxproj files.(R(R
((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytProjectVersion+scCs|jS(N(R(R
((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytFlatSolution/scCs|jS(s1Returns true if this version uses a vcxproj file.(R(R
((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytUsesVcxproj2scCs|jrdpdS(s+Returns the file extension for the project.s.vcxprojs.vcproj(R(R
((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytProjectExtension6scCs|jS(s/Returns the path to Visual Studio installation.(R(R
((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytPath:scCs%tjjtjj|jd|��S(s+Returns the path to a given compiler tool. sVC/bin(tosRtnormpathtjoin(R
ttool((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/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-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytDefaultToolsetBscCs�|dkst�tjjd�}|jr\|r\tjjtjj|d��d|gS|dkr|jdkr�|jddkr�tjjd	�d
ks�tjjd�d
kr�tjjtjj|jd��d
gStjjtjj|jd��gS|dkst�d}|jddkrktjjd	�d
ksbtjjd�d
krkd}ntjjtjj|jd��|gSdS(sLReturns a command (with arguments) to be used to set up the
    environment.tx86tx64t
WindowsSDKDirsBin/SetEnv.Cmdt/t2013i����tetPROCESSOR_ARCHITECTUREtAMD64tPROCESSOR_ARCHITEW6432sVC/vcvarsall.batt	amd64_x86sCommon7/Tools/vsvars32.batt	x86_amd64tamd64N(RR(	tAssertionErrorRtenvirontgetRRRRR(R
ttarget_archtsdk_dirtarg((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytSetupScriptGs*"				N(t__name__t
__module__t__doc__tNoneRRR
RRRRRRRRR,(((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/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(R1R2N(tsystplatformR0RRRR'R(textendt
subprocesstPopentPIPEtcommunicatet
returncode(tsysdirtkeytvaluetcmdtpttext((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt_RegistryQueryBasens$!	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(R0RFtOSErrorterrnotENOENT(RARBRER((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt_RegistryQuery�scCs�ddl}y`|jdd�\}}|dks9t�|j|j|��}|j||�dSWdQXWntk
r�dSXdS(sUse the _winreg module 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.  Throws
    ImportError if _winreg is unavailable.
  i����Ns\itHKLMi(t_winregtsplitR&tOpenKeytHKEY_LOCAL_MACHINEtQueryValueExtWindowsErrorR0(RARBRNtroottsubkeythkey((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt_RegistryGetValueUsingWinReg�s

cCsgyt||�SWntk
r$nXt||�}|s>dStjd|�}|sZdS|jd�S(s�Use _winreg or reg.exe to obtain the value of a registry key.

  Using _winreg is preferable because it solves an issue on some corporate
  environments where access to reg.exe is locked down. However, we still need
  to fallback to reg.exe for the case where the _winreg module is not available
  (for example in cygwin python).

  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(RWtImportErrorRLR0tretsearchtgroup(RARBREtmatch((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt_RegistryGetValue�s
cCs�|rtjj|�}nitdddddddtdtd	|d
|dd�d6td
ddddddtdtd	|d
|dd�d
6tdddddddtdtd	|d
|dd�d6tdddddddtdtd	|d
|dd�d6tdddddddtdtd	|d
|dd�d6tdddddddtdtd	|d
|�d6tdddddddtdtd	|d
|�d6tdddddd dtdtd	|d
|�d6td!ddddd dtdtd	|d
|�d!6td"d#dd dd$dtdtd	|d
|�d"6td%d#dd dd$dtdtd	|d
|�d%6}|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.
  t2015sVisual Studio 2015Rs12.00Rs14.0RRRRR	tv140RsVisual Studio 2013s13.00s12.0tv120t2013et2012sVisual Studio 2012s4.0tv110t2012et2010sVisual Studio 2010s11.00t2010esVisual C++ Express 2010t2008sVisual Studio 2008s10.00s9.00t2008et2005sVisual Studio 2005s8.00t2005e(RRRRtFalsetTruetstr(tnameRRtversions((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt_CreateVersion�s�










cCsJtjdkrFtjd|gdtj�}|j�dj�}n|S(s.Convert to cygwin path if we are using cygwin.R2tcygpathR6i(R8R9R;R<R=R>tstrip(RRD((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt_ConvertToCygpathFsc
	Cs�idd6dd6dd6dd6d	d
6dd6}g}x�|D]�}d
|d|d|d|g}x�tt|��D]�}t||d�}|s�qxnt|�}tjj|d�}tjj|d�}	|rtjj|�r|jt	||tjj|dd���qxt
j
|	�rx|jt	||dtjj|dd���qxqxWddg}x�tt|��D]s}t|||�}|s�q�nt|�}|dkr�|jt	||dtjj|d�dt��q�q�Wq=W|S(sWCollect 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)
      2013(e) - Visual Studio 2013 (12)
      2015    - Visual Studio 2015 (14)
    Where (e) is e for express editions of MSVS and blank otherwise.
  Ris8.0Rgs9.0Res10.0Rbs11.0Rs12.0R^s14.0s'HKLM\Software\Microsoft\VisualStudio\%ss3HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%ss$HKLM\Software\Microsoft\VCExpress\%ss0HKLM\Software\Wow6432Node\Microsoft\VCExpress\%st
InstallDirs
devenv.exes*express.exes..Rs,HKLM\Software\Microsoft\VisualStudio\SxS\VC7s8HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7R(trangetlenR]RsRRRtexiststappendRptglobRl(
tversions_to_checkt
force_expresstversion_to_yearRotversiontkeystindexRt	full_pathtexpress_path((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt_DetectVisualStudioVersionsNsJ


#	*tautocCsA|dkr$tjjdd�}nidd6dd	6dd
6dd6dd6dd
6d d6d!d6d"d6d#d6d$d6d%d6}tjjd�}|r�tjjd�}|s�td��nt||dt�St|�}t||d|k�}|s9|std��n|dkr)td	d&�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.
  R�tGYP_MSVS_VERSIONs14.0s12.0s10.0s9.0s8.0s11.0RiRjRgRhReRfRbRdRRaR^tGYP_MSVS_OVERRIDE_PATHs`GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be set to a particular version (e.g. 2010e).RRs,Could not locate Visual Studio installation.i(s14.0s12.0s10.0s9.0s8.0s11.0(s8.0(s8.0(s9.0(s9.0(s10.0(s10.0(s11.0(s11.0(s12.0(s12.0(s14.0N(	RR'R(t
ValueErrorRpRlRmR�R0(R}tallow_fallbacktversion_mapt
override_pathtmsvs_versionRo((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pytSelectVisualStudioVersion�s<	

(R/RJRRYR;R8tgypRytobjectRRFR0RLRWR]RkRpRsR�RlR�(((sm/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSVersion.pyt<module>s ^			k		C

?>