Commits

Anonymous committed 35e171d

Move query_versions() into MSVCCommon/vs.py. Fix variable names.

Comments (0)

Files changed (2)

src/engine/SCons/Tool/MSVCCommon/__init__.py

 import SCons.Errors
 import SCons.Platform.win32
 import SCons.Util
-# RDEVE: these item should be superseded by info stored in vs, right?
-#        keeping in because MSVS testing still rely on them
-from SCons.Tool.MSVCCommon.version import query_versions
 
 from SCons.Tool.MSVCCommon.misc import FindMSVSBatFile
 
 from SCons.Tool.MSVCCommon.vs import detect_msvs, \
                                      get_default_version, \
-                                     merge_default_version
+                                     merge_default_version, \
+                                     query_versions
 
 # Local Variables:
 # tab-width:4

src/engine/SCons/Tool/MSVCCommon/vs.py

 
         vars = ('LIB', 'LIBPATH', 'PATH', 'INCLUDE')
 
-        installed_msvs_list = get_installed_visual_studios()
+        msvs_list = get_installed_visual_studios()
         # TODO(1.5):
-        #vscommonvarnames = [ vs.common_tools_var for vs in installed ]
-        vscommonvarnames = map(lambda vs: vs.common_tools_var, installed)
+        #vscommonvarnames = [ vs.common_tools_var for vs in msvs_list ]
+        vscommonvarnames = map(lambda vs: vs.common_tools_var, msvs_list)
         nenv = normalize_env(env['ENV'], vscommonvarnames + ['COMSPEC'])
         output = get_output(batfilename, arch, env=nenv)
         vars = parse_output(output, vars)
         for k, v in vars.items():
             env.PrependENVPath(k, v, delete_existing=1)
 
+def query_versions():
+    """Query the system to get available versions of VS. A version is
+    considered when a batfile is found."""
+    msvs_list = get_installed_visual_studios()
+    # TODO(1.5)
+    #versions = [ msvs.version for msvs in msvs_list ]
+    versions = map(lambda msvs:  msvs.version, msvs_list)
+    return versions
+
 # Local Variables:
 # tab-width:4
 # indent-tabs-mode:nil