Back to index

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

List of all members.

Public Member Functions

def __init__
def set_macro
def load_macros
def sub

Public Attributes

 macros
 vsbase

Detailed Description

Definition at line 123 of file msvc9compiler.py.


Constructor & Destructor Documentation

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

Definition at line 125 of file msvc9compiler.py.

00125 
00126     def __init__(self, version):
00127         self.macros = {}
00128         self.vsbase = VS_BASE % version
00129         self.load_macros(version)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 133 of file msvc9compiler.py.

00133 
00134     def load_macros(self, version):
00135         self.set_macro("VCInstallDir", self.vsbase + r"\Setup\VC", "productdir")
00136         self.set_macro("VSInstallDir", self.vsbase + r"\Setup\VS", "productdir")
00137         self.set_macro("FrameworkDir", NET_BASE, "installroot")
00138         try:
00139             if version >= 8.0:
00140                 self.set_macro("FrameworkSDKDir", NET_BASE,
00141                                "sdkinstallrootv2.0")
00142             else:
00143                 raise KeyError("sdkinstallrootv2.0")
00144         except KeyError:
00145             raise DistutilsPlatformError(
00146             """Python was built with Visual Studio 2008;
00147 extensions must be built with a compiler than can generate compatible binaries.
00148 Visual Studio 2008 was not found on this system. If you have Cygwin installed,
00149 you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""")
00150 
00151         if version >= 9.0:
00152             self.set_macro("FrameworkVersion", self.vsbase, "clr version")
00153             self.set_macro("WindowsSdkDir", WINSDK_BASE, "currentinstallfolder")
00154         else:
00155             p = r"Software\Microsoft\NET Framework Setup\Product"
00156             for base in HKEYS:
00157                 try:
00158                     h = RegOpenKeyEx(base, p)
00159                 except RegError:
00160                     continue
00161                 key = RegEnumKey(h, 0)
00162                 d = Reg.get_value(base, r"%s\%s" % (p, key))
00163                 self.macros["$(FrameworkVersion)"] = d["version"]

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 130 of file msvc9compiler.py.

00130 
00131     def set_macro(self, macro, path, key):
00132         self.macros["$(%s)" % macro] = Reg.get_value(path, key)

Here is the caller graph for this function:

Definition at line 164 of file msvc9compiler.py.

00164 
00165     def sub(self, s):
00166         for k, v in self.macros.items():
00167             s = s.replace(k, v)
00168         return s

Here is the caller graph for this function:


Member Data Documentation

Definition at line 126 of file msvc9compiler.py.

Definition at line 127 of file msvc9compiler.py.


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