Back to index

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

List of all members.

Public Member Functions

def get_value
def read_keys
def read_values
def convert_mbcs

Static Public Attributes

tuple get_value = classmethod(get_value)
tuple read_keys = classmethod(read_keys)
tuple read_values = classmethod(read_values)
tuple convert_mbcs = staticmethod(convert_mbcs)

Detailed Description

Helper class to read values from the registry

Definition at line 61 of file msvc9compiler.py.


Member Function Documentation

Definition at line 113 of file msvc9compiler.py.

00113 
00114     def convert_mbcs(s):
00115         dec = getattr(s, "decode", None)
00116         if dec is not None:
00117             try:
00118                 s = dec("mbcs")
00119             except UnicodeError:
00120                 pass
        return s

Here is the call graph for this function:

def distutils.msvc9compiler.Reg.get_value (   cls,
  path,
  key 
)

Definition at line 65 of file msvc9compiler.py.

00065 
00066     def get_value(cls, path, key):
00067         for base in HKEYS:
00068             d = cls.read_values(base, path)
00069             if d and key in d:
00070                 return d[key]
        raise KeyError(key)

Here is the caller graph for this function:

def distutils.msvc9compiler.Reg.read_keys (   cls,
  base,
  key 
)
Return list of registry keys.

Definition at line 73 of file msvc9compiler.py.

00073 
00074     def read_keys(cls, base, key):
00075         """Return list of registry keys."""
00076         try:
00077             handle = RegOpenKeyEx(base, key)
00078         except RegError:
00079             return None
00080         L = []
00081         i = 0
00082         while True:
00083             try:
00084                 k = RegEnumKey(handle, i)
00085             except RegError:
00086                 break
00087             L.append(k)
00088             i += 1
        return L
def distutils.msvc9compiler.Reg.read_values (   cls,
  base,
  key 
)
Return dict of registry keys and values.

All names are converted to lowercase.

Definition at line 91 of file msvc9compiler.py.

00091 
00092     def read_values(cls, base, key):
00093         """Return dict of registry keys and values.
00094 
00095         All names are converted to lowercase.
00096         """
00097         try:
00098             handle = RegOpenKeyEx(base, key)
00099         except RegError:
00100             return None
00101         d = {}
00102         i = 0
00103         while True:
00104             try:
00105                 name, value, type = RegEnumValue(handle, i)
00106             except RegError:
00107                 break
00108             name = name.lower()
00109             d[cls.convert_mbcs(name)] = cls.convert_mbcs(value)
00110             i += 1
        return d

Member Data Documentation

Definition at line 121 of file msvc9compiler.py.

Definition at line 71 of file msvc9compiler.py.

Definition at line 89 of file msvc9compiler.py.

Definition at line 111 of file msvc9compiler.py.


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