diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-08-08 10:20:25 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-08-14 13:28:50 +0000 |
commit | 39a0ad8d31d6a39bfa607187b1d76478ccbe2513 (patch) | |
tree | e343a0920dfa76d47c8da96a284312e57627a1a3 /morphlib/buildsystem.py | |
parent | 4984492dc11888ae35452c437d666cb64dce1a87 (diff) | |
download | morph-39a0ad8d31d6a39bfa607187b1d76478ccbe2513.tar.gz |
buildsystem: Generate a Morphology not text
Rather than generating the text of a morphology which is later loaded,
generate a Morphology object and return that.
Diffstat (limited to 'morphlib/buildsystem.py')
-rw-r--r-- | morphlib/buildsystem.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/morphlib/buildsystem.py b/morphlib/buildsystem.py index 90cc15c2..fb99e70e 100644 --- a/morphlib/buildsystem.py +++ b/morphlib/buildsystem.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Codethink Limited +# Copyright (C) 2012-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,6 +16,8 @@ import os +import morphlib + class BuildSystem(object): @@ -49,19 +51,14 @@ class BuildSystem(object): key = '_'.join(key.split('-')) return getattr(self, key) - def get_morphology_text(self, name): + def get_morphology(self, name): '''Return the text of an autodetected chunk morphology.''' - return ''' - { - "name": "%(name)s", - "kind": "chunk", - "build-system": "%(bs)s" - } - ''' % { + return morphlib.morphology.Morphology({ 'name': name, - 'bs': self.name, - } + 'kind': 'chunk', + 'build-system': self.name, + }) def used_by_project(self, file_list): '''Does a project use this build system? |