]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/commitdiff
Use aliases in key_properties
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 27 Jun 2016 10:52:59 +0000 (12:52 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 27 Jun 2016 10:52:59 +0000 (12:52 +0200)
helpers/mapping.py

index 66d860d9bcf58b7ca747e4102a4b37f1838abebc..28f4acd278e7f3e8f5146d50bc4aa5cb2c5d0a36 100644 (file)
@@ -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":      []
                 }