def create(self, key, subkey):
""" Creates or 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 create/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.CreateKey(hkey, subkey)
self._keyname = subkey
except EnvironmentError, e:
raise RegistryError, e
评论列表
文章目录