Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
distutils.msvccompiler.MacroExpander Class Reference

List of all members.

Public Member Functions

def __init__
def set_macro
def load_macros
def sub

Public Attributes

 macros

Detailed Description

Definition at line 102 of file msvccompiler.py.


Constructor & Destructor Documentation

def distutils.msvccompiler.MacroExpander.__init__ (   self,
  version 
)

Definition at line 103 of file msvccompiler.py.

00103 
00104     def __init__(self, version):
00105         self.macros = {}
00106         self.load_macros(version)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def distutils.msvccompiler.MacroExpander.load_macros (   self,
  version 
)

Definition at line 114 of file msvccompiler.py.

00114 
00115     def load_macros(self, version):
00116         vsbase = r"Software\Microsoft\VisualStudio\%0.1f" % version
00117         self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir")
00118         self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir")
00119         net = r"Software\Microsoft\.NETFramework"
00120         self.set_macro("FrameworkDir", net, "installroot")
00121         try:
00122             if version > 7.0:
00123                 self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1")
00124             else:
00125                 self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
00126         except KeyError as exc: #
00127             raise DistutilsPlatformError(
00128             """Python was built with Visual Studio 2003;
00129 extensions must be built with a compiler than can generate compatible binaries.
00130 Visual Studio 2003 was not found on this system. If you have Cygwin installed,
00131 you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""")
00132 
00133         p = r"Software\Microsoft\NET Framework Setup\Product"
00134         for base in HKEYS:
00135             try:
00136                 h = RegOpenKeyEx(base, p)
00137             except RegError:
00138                 continue
00139             key = RegEnumKey(h, 0)
00140             d = read_values(base, r"%s\%s" % (p, key))
00141             self.macros["$(FrameworkVersion)"] = d["version"]

Here is the call graph for this function:

def distutils.msvccompiler.MacroExpander.set_macro (   self,
  macro,
  path,
  key 
)

Definition at line 107 of file msvccompiler.py.

00107 
00108     def set_macro(self, macro, path, key):
00109         for base in HKEYS:
00110             d = read_values(base, path)
00111             if d:
00112                 self.macros["$(%s)" % macro] = d[key]
00113                 break

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 142 of file msvccompiler.py.

00142 
00143     def sub(self, s):
00144         for k, v in self.macros.items():
00145             s = s.replace(k, v)
00146         return s

Here is the call graph for this function:


Member Data Documentation

Definition at line 104 of file msvccompiler.py.


The documentation for this class was generated from the following file: