summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-06-19 13:55:30 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2014-07-10 13:57:32 +0000
commit597f2a19363b7e91b928d814627c9236779998fb (patch)
treea6577fd429433b8e251e4eb34f0f2ff23d325f67 /scripts
parent670bcd28354ed2d44c02eaa0d0d1a78f6c49458d (diff)
downloadmorph-597f2a19363b7e91b928d814627c9236779998fb.tar.gz
yarns: Adapt to put morphologies in subdirsbaserock/richardmaw/S11284/morphologies-by-path-v4
We want to move our morphologies in our definitions repository into subdirectories, so they're more organised. We'd prefer to only refer to morphologies by file path, rather than a name that loosely corresponds to the file path, but we need to support that for backwards compatibility until we can move all of our morphologies into the definitions repository. However, since we want to eventually remove this, and we want to ensure that file paths work, we change the yarn tests to use file paths.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/edit-morph6
1 files changed, 1 insertions, 5 deletions
diff --git a/scripts/edit-morph b/scripts/edit-morph
index 2b81747c..d0b793a4 100755
--- a/scripts/edit-morph
+++ b/scripts/edit-morph
@@ -283,13 +283,9 @@ class EditMorph(cliapp.Application):
return system
def cmd_cluster_init(self, (cluster_file,)):
- suffix = '.morph'
- if not cluster_file.endswith(suffix):
- raise cliapp.AppException(
- "Morphology file path must end with .morph")
with open(cluster_file, 'w') as f:
d = {
- 'name': os.path.basename(cluster_file)[:-len(suffix)],
+ 'name': os.path.splitext(os.path.basename(cluster_file))[0],
'kind': 'cluster',
}
yaml.dump(d, f)