summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2014-08-05 15:51:33 (GMT)
committerFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2014-08-05 15:51:33 (GMT)
commita9bb6e6a557612484fecc03517a7f89f0f20bbc5 (patch)
treede843b35a2c2fe250bcfef673033230fcdf83d7a
parentff5016fb52632a4ee2120448a3b123552ab32f9f (diff)
downloaddefinitions-a9bb6e6a557612484fecc03517a7f89f0f20bbc5.tar.gz
WIP: fix clusters
-rwxr-xr-xscripts/migrate-chunks40
1 files changed, 20 insertions, 20 deletions
diff --git a/scripts/migrate-chunks b/scripts/migrate-chunks
index 8faee49..90f5b7c 100755
--- a/scripts/migrate-chunks
+++ b/scripts/migrate-chunks
@@ -35,49 +35,49 @@ def move_morphs(morphs, kind):
if kind == 'cluster':
print 'Moving %s into subdirectory' % kind
subdir = os.path.join(definitions_repo, 'cluster')
- subprocess.call(['mkdir','-p', subdir])
+ subprocess.call(['mkdir', '-p', subdir])
for morph in morphs:
- print 'Initial: %s' % str(morph)
- morph['systems'][0]['morph'] = str( 'systems/' + morph['systems'][0]['morph'] + '.morph')
- new_morph = loader.parse_morphology_text(str(morph), morph.filename)
- loader.save_to_file(morph.filename,new_morph)
+ for m in morph['systems']:
+ m['morph'] = str('systems/' + m['morph'] + '.morph')
+ #loader.save_to_file(morph.filename, morph)
new_location = os.path.join(subdir, morph.filename)
- subprocess.call(['git', 'mv', morph.filename, new_location])
+ loader.save_to_file(morph.filename, morph)
+ #subprocess.call(['git', 'mv', morph.filename, new_location])
+ sys.exit(0)
#morph.filename = new_location
#subprocess.call(['git', 'commit', '--quiet', '-m',
# 'Move %s into subdirectory' %kind])
if kind == 'system':
print 'Moving %s into subdirectory' % kind
subdir = os.path.join(definitions_repo, 'system')
- subprocess.call(['mkdir','-p', subdir])
+ subprocess.call(['mkdir', '-p', subdir])
for morph in morphs:
#print 'Initial: %s' % str(morph)
for stratum in morph['strata']:
stratum['morph'] = str('strata/' + stratum['morph'] + '.morph')
- new_morph = loader.parse_morphology_text(str(morph), morph.filename)
- loader.save_to_file(morph.filename,new_morph)
+ loader.save_to_file(morph.filename,morph)
new_location = os.path.join(subdir, morph.filename)
subprocess.call(['git', 'mv', morph.filename, new_location])
#morph.filename = new_location
#subprocess.call(['git', 'commit', '--quiet', '-m',
# 'Move %s into subdirectory' %kind])
- sys.exit(0)
- for morph in morphs:
- print '%s' %morph
- str_morph = str(morph)
- new_morph = loader.parse_morphology_text(str_morph, morph.filename)
- new_location = os.path.join(subdir, morph.filename.replace('-' + kind,'',1))
- loader.save_to_file(new_location,new_morph)
- print '%s' % new_location
- sys.exit(0)
+ sys.exit(0)
+
+ #for morph in morphs:
+# print '%s' %morph
+# str_morph = str(morph)
+# new_morph = loader.parse_morphology_text(str_morph, morph.filename)
+# new_location = os.path.join(subdir, morph.filename.replace('-' + kind,'',1))
+# loader.save_to_file(new_location,new_morph)
+# print '%s' % new_location
+# sys.exit(0)
#subprocess.call(['git', 'mv', morph.filename, new_location])
#morph.filename = new_location
#subprocess.call(['git', 'commit', '--quiet', '-m',
# 'Move %s into subdirectory' % kind]m
for key in morphologies.iterkeys():
- if key in ['system', 'cluster'] :
- move_morphs(morphologies[key], key)
+ move_morphs(morphologies[key], key)
#move_morphs(chunks, 'chunks')
#move_morphs(strata, 'strata')