aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-27 12:52:59 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-27 12:52:59 +0200
commite5edd8b96e0e5e8be4adadab5a2f56e83cfdd264 (patch)
tree41f4b410ff2080c2ea0d068313c99476c1475f2e
parentcc008de481bf1b67790d48b648d7c8207b9f50ea (diff)
downloadMusicSampler-e5edd8b96e0e5e8be4adadab5a2f56e83cfdd264.tar.gz
MusicSampler-e5edd8b96e0e5e8be4adadab5a2f56e83cfdd264.tar.zst
MusicSampler-e5edd8b96e0e5e8be4adadab5a2f56e83cfdd264.zip
Use aliases in key_properties
-rw-r--r--helpers/mapping.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/helpers/mapping.py b/helpers/mapping.py
index 66d860d..28f4acd 100644
--- a/helpers/mapping.py
+++ b/helpers/mapping.py
@@ -86,9 +86,20 @@ class Mapping(RelativeLayout):
86 86
87 for key in config['key_properties']: 87 for key in config['key_properties']:
88 if key not in key_properties: 88 if key not in key_properties:
89 key_prop = config['key_properties'][key]
90 if 'include' in key_prop:
91 included = key_prop['include']
92 del(key_prop['include'])
93
94 if isinstance(included, str):
95 key_prop.update(aliases[included], **key_prop)
96 else:
97 for included_ in included:
98 key_prop.update(aliases[included_], **key_prop)
99
89 key_properties[key] = { 100 key_properties[key] = {
90 "actions": [], 101 "actions": [],
91 "properties": config['key_properties'][key], 102 "properties": key_prop,
92 "files": [] 103 "files": []
93 } 104 }
94 105