From: Ismaƫl Bouya Date: Mon, 27 Jun 2016 10:52:59 +0000 (+0200) Subject: Use aliases in key_properties X-Git-Tag: 1.0.0~69 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git;a=commitdiff_plain;h=e5edd8b96e0e5e8be4adadab5a2f56e83cfdd264 Use aliases in key_properties --- 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): for key in config['key_properties']: if key not in key_properties: + key_prop = config['key_properties'][key] + if 'include' in key_prop: + included = key_prop['include'] + del(key_prop['include']) + + if isinstance(included, str): + key_prop.update(aliases[included], **key_prop) + else: + for included_ in included: + key_prop.update(aliases[included_], **key_prop) + key_properties[key] = { "actions": [], - "properties": config['key_properties'][key], + "properties": key_prop, "files": [] }