summaryrefslogtreecommitdiff
path: root/morphlib/morphloader.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/morphloader.py')
-rw-r--r--morphlib/morphloader.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py
index 0249bbae..d06c06dc 100644
--- a/morphlib/morphloader.py
+++ b/morphlib/morphloader.py
@@ -406,6 +406,7 @@ class MorphologyLoader(object):
m = self.parse_morphology_text(string, filename)
m.filename = filename
self.validate(m)
+ self.set_commands(m)
self.set_defaults(m)
return m
@@ -754,3 +755,13 @@ class MorphologyLoader(object):
if morph['max-jobs'] is not None:
morph['max-jobs'] = int(morph['max-jobs'])
+ def set_commands(self, morph):
+ if morph['kind'] == 'chunk':
+ for key in self._static_defaults['chunk']:
+ if 'commands' not in key: continue
+ if key not in morph:
+ attr = '_'.join(key.split('-'))
+ default = self._static_defaults['chunk']['build-system']
+ bs = morphlib.buildsystem.lookup_build_system(
+ morph.get('build-system', default))
+ morph[key] = getattr(bs, attr)