parameters: ()
docstring: Return path to the GYP_MSVS_VERSION of Visual Studio.
docstring_summary: Return path to the GYP_MSVS_VERSION of Visual Studio.
docstring_tokens: Return path to the GYP_MSVS_VERSION of Visual Studio .
function: def DetectVisualStudioPath():
    """Return path to the GYP_MSVS_VERSION of Visual Studio.
    """
  
    # Note that this code is used from
    # build/toolchain/win/setup_toolchain.py as well.
    version_as_year = GetVisualStudioVersion()
    year_to_version = {
        '2013': '12.0',
        '2015': '14.0',
    }
    if version_as_year not in year_to_version:
      raise Exception(('Visual Studio version %s (from GYP_MSVS_VERSION)'
                       ' not supported. Supported versions are: %s') % (
                         version_as_year, ', '.join(year_to_version.keys())))
    version = year_to_version[version_as_year]
    keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version,
            r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version]
    for key in keys:
      path = _RegistryGetValue(key, 'InstallDir')
      if not path:
        continue
      path = os.path.normpath(os.path.join(path, '..', '..'))
      return path
  
    raise Exception(('Visual Studio Version %s (from GYP_MSVS_VERSION)'
                     ' not found.') % (version_as_year))
function_tokens: def DetectVisualStudioPath ( ) : # Note that this code is used from # build/toolchain/win/setup_toolchain.py as well. version_as_year = GetVisualStudioVersion ( ) year_to_version = { '2013' : '12.0' , '2015' : '14.0' , } if version_as_year not in year_to_version : raise Exception ( ( 'Visual Studio version %s (from GYP_MSVS_VERSION)' ' not supported. Supported versions are: %s' ) % ( version_as_year , ', ' . join ( year_to_version . keys ( ) ) ) ) version = year_to_version [ version_as_year ] keys = [ r'HKLM\Software\Microsoft\VisualStudio\%s' % version , r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version ] for key in keys : path = _RegistryGetValue ( key , 'InstallDir' ) if not path : continue path = os . path . normpath ( os . path . join ( path , '..' , '..' ) ) return path raise Exception ( ( 'Visual Studio Version %s (from GYP_MSVS_VERSION)' ' not found.' ) % ( version_as_year ) )