summaryrefslogtreecommitdiff
path: root/morphlib/morphology.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-01 14:22:42 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-01 14:22:42 +0000
commit3406f96c72714081ff0b1d90aca8189389ad40ae (patch)
tree75ee646376749d62332de5de7339a10bdec94043 /morphlib/morphology.py
parent23b603aede1dd86cf699dd0f7cd43aae51adc870 (diff)
downloadmorph-3406f96c72714081ff0b1d90aca8189389ad40ae.tar.gz
Make 'repo' in strata sources lists default to name of chunk
In other words, consider the follow bit of stratum morphology: { "name": "foo", "kind": "stratum", "sources": { "bar": { "repo": "bar", "ref": "baserock" } } } The "repo" field duplicates the name of the key in "sources". This is unnecessary now, so the "repo" field can be removed.
Diffstat (limited to 'morphlib/morphology.py')
-rw-r--r--morphlib/morphology.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/morphlib/morphology.py b/morphlib/morphology.py
index fbaa8c82..3155bf95 100644
--- a/morphlib/morphology.py
+++ b/morphlib/morphology.py
@@ -32,7 +32,9 @@ class Morphology(object):
self._dict = json.load(self._fp)
if self.kind == 'stratum':
- for source in self.sources.itervalues():
+ for name, source in self.sources.iteritems():
+ if 'repo' not in source:
+ source['repo'] = name
source['repo'] = self._join_with_baseurl(source['repo'])
self.filename = self._fp.name