def map_key(self, key):
        """ Map key names to Windows registry key constants """
        
        if type(key) is not str:
            raise RegistryError,"key must be a string object"
        else:
            try:
                return eval('wreg.' + key)
            except AttributeError:
                return None
 Map key names to Windows registry key constants 
recipes/Python/476229_YARW__Yet_Another_Registry/recipe-476229.py