summaryrefslogtreecommitdiff
path: root/morphlib/morph2.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/morph2.py')
-rw-r--r--morphlib/morph2.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/morph2.py b/morphlib/morph2.py
index a8e1d7d3..d949c696 100644
--- a/morphlib/morph2.py
+++ b/morphlib/morph2.py
@@ -85,6 +85,15 @@ class Morphology(object):
def __contains__(self, key):
return key in self._dict
+ def get_commands(self, which):
+ '''Return the commands to run from a morphology or the build system'''
+ if self[which] is None:
+ attr = '_'.join(which.split('-'))
+ bs = morphlib.buildsystem.lookup_build_system(self['build-system'])
+ return getattr(bs, attr)
+ else:
+ return self[which]
+
def keys(self):
return self._dict.keys()