Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm Lost #1

Open
dkruben opened this issue Oct 18, 2023 · 0 comments
Open

I'm Lost #1

dkruben opened this issue Oct 18, 2023 · 0 comments

Comments

@dkruben
Copy link

dkruben commented Oct 18, 2023

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)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant