7 dirs = ['ancient','chords','connecting','contemporary','expressive','guitar','parts','repeats','spacing','staff','text','vocal']
13 print "Please specify input_file."
16 def copy_with_warning(src, dest):
17 msg = '%% Do not edit this file; it is auto-generated from LSR!\n'
18 open (dest, 'w').write( msg + open (src).read() )
21 def copy_dir_with_test(srcdir, destdir):
22 if not(os.path.exists(srcdir)):
24 file_names = os.listdir (srcdir)
25 for file in file_names:
26 src = os.path.join (srcdir, file)
27 dest = os.path.join (destdir, file)
28 copy_with_warning(src, dest)
29 s = os.system('lilypond -dsafe -dbackend=svg -o /tmp/lsrtest ' + dest)
35 srcdir = os.path.join (in_dir, dir)
36 destdir = os.path.join ('input', 'lsr', dir)
37 if not(os.path.isdir(destdir)):
38 print "Please run this script from the head of the source tree,"
39 print " and/or check that you have the right categories."
42 ## clean out existing files
43 file_names = os.listdir (destdir)
44 for file in file_names:
45 if (file.endswith ('.ly')):
46 if (file[:3] != 'AAA'):
47 os.remove( os.path.join(destdir,file) )
49 ## copy in new files from LSR download
50 copy_dir_with_test( srcdir, destdir )
51 ## copy in new files in source tree
52 copy_dir_with_test( os.path.join ('input', 'tolsr', dir), destdir )
55 file=open("lsr-unsafe.txt", 'w')
61 print "Unsafe files printed in lsr-unsafe.txt: CHECK MANUALLY!"
62 print " xargs git-diff < lsr-unsafe.txt"