8 ['ancient','chords','connecting','contemporary','expressive','education','guitar','parts','pitch','repeats','scheme','spacing','staff','text','vocal','other','non-music','engravers','instrument-specific']
14 print "Please specify input_file."
17 def copy_with_warning(src, dest):
18 msg = '%% Do not edit this file; it is auto-generated from LSR!\n'
19 open (dest, 'w').write( msg + open (src).read() )
22 def copy_dir_with_test(srcdir, destdir):
23 if not(os.path.exists(srcdir)):
25 file_names = os.listdir (srcdir)
26 for file in file_names:
27 if (file.endswith ('.ly')):
28 src = os.path.join (srcdir, file)
29 dest = os.path.join (destdir, file)
30 copy_with_warning(src, dest)
31 os.system('convert-ly -e ' + dest)
32 s = os.system('lilypond -dno-print-pages -dsafe -o /tmp/lsrtest ' + dest)
38 srcdir = os.path.join (in_dir, dir)
39 destdir = os.path.join ('input', 'lsr', dir)
40 if not(os.path.isdir(destdir)):
41 print "Please run this script from the head of the source tree,"
42 print " and/or check that you have the right categories."
45 ## clean out existing files
46 file_names = os.listdir (destdir)
47 for file in file_names:
48 if (file.endswith ('.ly')):
49 os.remove( os.path.join(destdir,file) )
50 ## copy in new files from LSR download
51 copy_dir_with_test( srcdir, destdir )
52 ## copy in new files in source tree
53 copy_dir_with_test( os.path.join ('input', 'new', dir), destdir )
56 file=open("lsr-unsafe.txt", 'w')
62 print "Unsafe files printed in lsr-unsafe.txt: CHECK MANUALLY!"
63 print " xargs git-diff < lsr-unsafe.txt"