Skip to content

I'm Lost #1

@dkruben

Description

@dkruben

File ".../config/utils.py", line 42, in processHotKeys
File ".../config/utils.py", line 37, in
File ".../config/utils.py", line 32, in
AttributeError: 'module' object has no attribute 'KEY__'

def processHotKeys(data, keys, mode):
add = lambda key: key if 'KEY_' in key else 'KEY_' + key
if mode == 'read':
process = lambda key: getattr(Keys, add(key))
elif mode == 'write':
process = lambda key: SPECIAL_TO_KEYS.get(key) or add(BigWorld.keyToString(key))
else:
assert False, 'unknown hotkey conversion mode'
make = lambda keySet: [make(key) if isinstance(key, (list, tuple)) else process(key) for key in keySet]
for dataKey in keys: # configs have 'Key', code checks for 'key'. >_<
newKey = dataKey.replace('key', 'Key')
if (newKey if mode == 'read' else dataKey) not in data:
continue
data[(dataKey if mode == 'read' else newKey)] = make(data.pop((newKey if mode == 'read' else dataKey)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions