From 39a0ad8d31d6a39bfa607187b1d76478ccbe2513 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Fri, 8 Aug 2014 10:20:25 +0000 Subject: 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. --- morphlib/buildsystem.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'morphlib/buildsystem.py') 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? -- cgit v1.2.1