summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Tool/msvsTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Tool/msvsTests.py')
-rw-r--r--src/engine/SCons/Tool/msvsTests.py54
1 files changed, 28 insertions, 26 deletions
diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py
index ce4edd5..f45b702 100644
--- a/src/engine/SCons/Tool/msvsTests.py
+++ b/src/engine/SCons/Tool/msvsTests.py
@@ -21,10 +21,9 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/msvsTests.py 4720 2010/03/24 03:14:11 jars"
+__revision__ = "src/engine/SCons/Tool/msvsTests.py 5023 2010/06/14 22:05:46 scons"
import os
-import string
import sys
import TestCmd
import unittest
@@ -39,7 +38,7 @@ from SCons.Tool.MSCommon.common import debug
from SCons.Tool.MSCommon import get_default_version, \
query_versions
-regdata_6a = string.split(r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
+regdata_6a = r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0]
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\ServicePacks]
"sp3"=""
@@ -49,9 +48,9 @@ regdata_6a = string.split(r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudi
"ProductDir"="C:\Program Files\Microsoft Visual Studio\MSDN98\98VSa\1033"
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++]
"ProductDir"="C:\Program Files\Microsoft Visual Studio\VC98"
-''','\n')
+'''.split('\n')
-regdata_6b = string.split(r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
+regdata_6b = r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0]
"InstallDir"="C:\VS6\Common\IDE\IDE98"
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\ServicePacks]
@@ -68,9 +67,9 @@ regdata_6b = string.split(r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudi
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft VSEE Client]
"ProductDir"="C:\VS6\Common\Tools"
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Visual Studio 98]
-''','\n')
+'''.split('\n')
-regdata_7 = string.split(r'''
+regdata_7 = r'''
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0]
"InstallDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
"Source Directories"="C:\Program Files\Microsoft Visual Studio .NET\Vc7\crt\;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\src\mfc\;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\src\atl\"
@@ -134,9 +133,9 @@ regdata_7 = string.split(r'''
"Include Dirs"="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include\prerelease;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include"
"Source Dirs"="$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src"
"Reference Dirs"=""
-''','\n')
+'''.split('\n')
-regdata_7_1 = string.split(r'''
+regdata_7_1 = r'''
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1]
@=""
"Source Directories"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\mfc\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\atl\"
@@ -240,9 +239,9 @@ regdata_7_1 = string.split(r'''
"VCManagedWrapperGeneratorTool"=""
"VCAuxiliaryManagedWrapperGeneratorTool"=""
"VCPrimaryInteropTool"=""
-''','\n')
+'''.split('\n')
-regdata_8exp = string.split(r'''
+regdata_8exp = r'''
[HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0]
"CLR Version"="v2.0.50727"
"ApplicationID"="VCExpress"
@@ -284,9 +283,9 @@ regdata_8exp = string.split(r'''
"VCXMLDataGeneratorTool"="*.xsd"
"VCManifestTool"="*.manifest"
"VCXDCMakeTool"="*.xdc"
-''','\n')
+'''.split('\n')
-regdata_80 = string.split(r'''
+regdata_80 = r'''
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0]
"CLR Version"="v2.0.50727"
"ApplicationID"="VisualStudio"
@@ -346,18 +345,18 @@ regdata_80 = string.split(r'''
"VCXMLDataGeneratorTool"="*.xsd"
"VCManifestTool"="*.manifest"
"VCXDCMakeTool"="*.xdc"
-''','\n')
+'''.split('\n')
-regdata_cv = string.split(r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion]
+regdata_cv = r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion]
"ProgramFilesDir"="C:\Program Files"
"CommonFilesDir"="C:\Program Files\Common Files"
"MediaPath"="C:\WINDOWS\Media"
-''','\n')
+'''.split('\n')
regdata_none = []
-class DummyEnv:
+class DummyEnv(object):
def __init__(self, dict=None):
if dict:
self.dict = dict
@@ -375,17 +374,20 @@ class DummyEnv:
def __getitem__(self,key):
return self.dict[key]
+ def __contains__(self,key):
+ return key in self.dict
+
def has_key(self,name):
- return self.dict.has_key(name)
+ return name in self.dict
-class RegKey:
+class RegKey(object):
"""key class for storing an 'open' registry key"""
def __init__(self,key):
self.key = key
# Warning: this is NOT case-insensitive, unlike the Windows registry.
# So e.g. HKLM\Software is NOT the same key as HKLM\SOFTWARE.
-class RegNode:
+class RegNode(object):
"""node in the dummy registry"""
def __init__(self,name):
self.valdict = {}
@@ -395,7 +397,7 @@ class RegNode:
self.name = name
def value(self,val):
- if self.valdict.has_key(val):
+ if val in self.valdict:
return (self.valdict[val],1)
else:
raise SCons.Util.RegError
@@ -428,13 +430,13 @@ class RegNode:
raise SCons.Util.RegError
def addKey(self,name,sep = '\\'):
- if string.find(name, sep) != -1:
- keyname, subkeys = string.split(name, sep, 1)
+ if name.find(sep) != -1:
+ keyname, subkeys = name.split(sep, 1)
else:
keyname = name
subkeys = ""
- if not self.keydict.has_key(keyname):
+ if keyname not in self.keydict:
self.keydict[keyname] = RegNode(keyname)
self.keyarray.append(keyname)
@@ -460,7 +462,7 @@ class RegNode:
rv = rv + indent + '}\n'
return rv
-class DummyRegistry:
+class DummyRegistry(object):
"""registry class for storing fake registry attributes"""
def __init__(self,data):
"""parse input data into the fake registry"""
@@ -739,7 +741,7 @@ if __name__ == "__main__":
for k in ['VS71COMNTOOLS',
'VS80COMNTOOLS',
'VS90COMNTOOLS']:
- if os.environ.has_key(k):
+ if k in os.environ:
del os.environ[k]
suite = unittest.makeSuite(test_class, 'test_')