Exemple #1
0
 def __setitem__(self, path, value):
     do_copy = isinstance(value, RegistryKey)
     if not do_copy and not isinstance(value, str)    \
                    and not isinstance(value, unicode):
         if isinstance(value, object):
             t = value.__class__.__name__
         else:
             t = type(value)
         raise TypeError("Expected string or RegistryKey, got %s" % t)
     hive, subpath = self._parse_path(path)
     with win32.RegCreateKey(hive, subpath) as handle:
         if do_copy:
             win32.RegCopyTree(value.handle, None, handle)
         else:
             win32.RegSetValueEx(handle, None, value)
Exemple #2
0
 def __setitem__(self, name, value):
     win32.RegSetValueEx(self.handle, name, value)