def open(self, key, subkey):
""" Opens a Windows registry key. The first param is one of the
Windows HKEY names or an already open key. The second param
is the actual key to open. """
if type(key) is str:
hkey = Registry.map_key(key)
else:
hkey = key
if not hkey: raise RegistryError,"could not find registry key for %s" % key
try:
self._hkey = wreg.OpenKey(hkey, subkey)
self._keyname = subkey
except EnvironmentError, e:
raise RegistryError, e
评论列表
文章目录