mirror of
https://github.com/lutris/lutris
synced 2024-10-14 11:42:36 +00:00
Load registry version from file
This commit is contained in:
parent
49ccfacc53
commit
b1e0f4709f
|
@ -71,11 +71,14 @@ class WineRegistry(object):
|
||||||
for line in registry_lines:
|
for line in registry_lines:
|
||||||
# Remove trailing newlines
|
# Remove trailing newlines
|
||||||
line = line.rstrip('\n')
|
line = line.rstrip('\n')
|
||||||
|
if line.startswith('WINE REGISTRY Version'):
|
||||||
|
self.version = line[len('WINE REGISTRY Version '):]
|
||||||
|
continue
|
||||||
if line.startswith('#arch'):
|
if line.startswith('#arch'):
|
||||||
self.arch = line.split('=')[1]
|
self.arch = line.split('=')[1]
|
||||||
continue
|
continue
|
||||||
if line.startswith('['):
|
if line.startswith('['):
|
||||||
current_key = WineRegistryKey(line)
|
current_key = WineRegistryKey(key_def=line)
|
||||||
self.keys.append(current_key)
|
self.keys.append(current_key)
|
||||||
self.key_map[current_key.name] = key_index
|
self.key_map[current_key.name] = key_index
|
||||||
key_index += 1
|
key_index += 1
|
||||||
|
@ -111,7 +114,7 @@ class WineRegistry(object):
|
||||||
|
|
||||||
|
|
||||||
class WineRegistryKey(object):
|
class WineRegistryKey(object):
|
||||||
def __init__(self, key_def):
|
def __init__(self, key_def=None):
|
||||||
self.raw_name = key_def[:key_def.index(']') + 1]
|
self.raw_name = key_def[:key_def.index(']') + 1]
|
||||||
|
|
||||||
# Parse timestamp either as int or float
|
# Parse timestamp either as int or float
|
||||||
|
|
Loading…
Reference in a new issue