mirror of
https://github.com/lutris/lutris
synced 2024-10-06 15:59:39 +00:00
Add support for dword registry keys
This commit is contained in:
parent
01e3c5f637
commit
6ad63c45da
|
@ -153,5 +153,7 @@ class WineRegistryKey(object):
|
|||
value = self.values[name]
|
||||
if value.startswith("\"") and value.endswith("\""):
|
||||
return value[1:-1]
|
||||
elif value.startswith('dword:'):
|
||||
return int(value[6:], 16)
|
||||
else:
|
||||
raise ValueError("TODO: finish handling other types")
|
||||
|
|
|
@ -28,3 +28,11 @@ class TestWineRegistry(TestCase):
|
|||
def test_can_get_meta(self):
|
||||
key = self.registry.get_key('Control Panel/Sound')
|
||||
self.assertEqual(key.get_meta('time'), '1d21cc468677196')
|
||||
|
||||
def test_can_get_string_value(self):
|
||||
key = self.registry.get_key('Control Panel/Desktop')
|
||||
self.assertEqual(key.get_value('DragFullWindows'), '0')
|
||||
|
||||
def test_can_get_dword_value(self):
|
||||
key = self.registry.get_key('Control Panel/Desktop')
|
||||
self.assertEqual(key.get_value('CaretWidth'), 1)
|
||||
|
|
Loading…
Reference in a new issue