Keymap: support for reading/writing keymaps as data
Instead of running code to create a keymap, store them as data. This allows for keymaps to share content as well as running transformations at load time.
This commit is contained in:
@@ -581,8 +581,13 @@ def keyconfig_set(filepath, report=None):
|
||||
try:
|
||||
error_msg = ""
|
||||
with open(filepath, 'r', encoding='utf-8') as keyfile:
|
||||
exec(compile(keyfile.read(), filepath, "exec"),
|
||||
{"__file__": filepath})
|
||||
exec(
|
||||
compile(keyfile.read(), filepath, "exec"),
|
||||
{
|
||||
"__file__": filepath,
|
||||
"__name__": "__main__",
|
||||
}
|
||||
)
|
||||
except:
|
||||
import traceback
|
||||
error_msg = traceback.format_exc()
|
||||
|
||||
Reference in New Issue
Block a user