diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-11-02 14:37:35 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-11-02 14:37:35 +0000 |
commit | b45c93ff4d7029065ccd26cad3f69cf2f30461da (patch) | |
tree | a60b3544704cc656577eb7fba1f52d8a73caf173 /morph | |
parent | b90aad231183b5bdf7116711f82c93201ce086c8 (diff) | |
download | morph-b45c93ff4d7029065ccd26cad3f69cf2f30461da.tar.gz |
Always get all morphologies from git
Previously, we've been able to get morphs for strata and systems
directly from files, with uncommitted changes. No more.
Diffstat (limited to 'morph')
-rwxr-xr-x | morph | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -47,17 +47,22 @@ class Morph(cliapp.Application): metavar='N', default=0) - def cmd_build(self, morph_filenames): + def cmd_build(self, args): tempdir = morphlib.tempdir.Tempdir() builder = morphlib.builder.Builder(tempdir, self.msg, self.settings) - for name in morph_filenames: - self.msg('Building morphology %s' % name) - with self.open_input(name, 'r') as f: - morph = morphlib.morphology.Morphology(f, - baseurl=self.settings['git-base-url']) - builder.build(morph, '', '') + + while len(args) >= 3: + repo, ref, filename = args[:3] + args = args[3:] + self.msg('Building %s - %s - %s' % (repo, ref, filename)) + builder.build(repo, ref, filename) + tempdir.remove() + if args: + raise cliapp.AppException('Extra args on command line: %s' % args) + + def msg(self, msg): '''Show a message to the user about what is going on.''' logging.debug(msg) |