diff options
Diffstat (limited to 'morphlib/morphloader.py')
-rw-r--r-- | morphlib/morphloader.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py index 8289b01e..7d51dc1e 100644 --- a/morphlib/morphloader.py +++ b/morphlib/morphloader.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2014 Codethink Limited +# Copyright (C) 2013-2015 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 @@ -111,14 +111,6 @@ class UnknownArchitectureError(MorphologyValidationError): % (arch, morph_filename)) -class NoBuildDependenciesError(MorphologyValidationError): - - def __init__(self, stratum_name, chunk_name, morph_filename): - self.msg = ( - 'Stratum %s has no build dependencies for chunk %s in %s' % - (stratum_name, chunk_name, morph_filename)) - - class NoStratumBuildDependenciesError(MorphologyValidationError): def __init__(self, stratum_name, morph_filename): @@ -398,13 +390,17 @@ class MorphologyLoader(object): return morphlib.morphology.Morphology(obj) - def load_from_string(self, string, filename='string'): + def load_from_string(self, string, + filename='string'): # pragma: no cover '''Load a morphology from a string. Return the Morphology object. ''' + if string is None: + return None + m = self.parse_morphology_text(string, filename) m.filename = filename self.validate(m) @@ -552,7 +548,7 @@ class MorphologyLoader(object): # Validate build-dependencies if specified self._validate_stratum_specs_fields(morph, 'build-depends') - # Require build-dependencies for each chunk. + # Check build-dependencies for each chunk. for spec in morph['chunks']: chunk_name = spec.get('alias', spec['name']) if 'build-depends' in spec: @@ -560,9 +556,6 @@ class MorphologyLoader(object): raise InvalidTypeError( '%s.build-depends' % chunk_name, list, type(spec['build-depends']), morph['name']) - else: - raise NoBuildDependenciesError( - morph['name'], chunk_name, morph.filename) @classmethod def _validate_chunk(cls, morphology): |