7 # 'expressive' not available yet
8 dirs = ['ancient','chords','connecting','contemporary','expressive','guitar','parts','repeats','spacing','staff','text','vocal']
14 print "Please specify input_file."
17 def copyWithWarning(src, dest):
18 readFile = open(src, 'r')
19 readFileLines = readFile.readlines()
21 writeFile = open(dest, 'w')
22 writeFile.write('%% Do not edit this file; it is auto-generated from LSR!\n')
23 for line in readFileLines:
28 srcdir = os.path.join (in_dir, dir)
29 destdir = os.path.join ('input', 'lsr', dir)
30 if not(os.path.isdir(destdir)):
31 print "Please run this script from the head of the source tree,"
32 print " and/or check that you have the right categories."
35 file_names = os.listdir (destdir)
36 for file in file_names:
37 if (file.endswith ('.ly')):
38 if (file[:3] != 'AAA'):
39 os.remove( os.path.join(destdir,file) )
41 file_names = os.listdir (in_dir + dir)
42 for file in file_names:
43 src = os.path.join (srcdir, file)
44 dest = os.path.join (destdir, file)
45 copyWithWarning(src, dest)
46 # shutil.copyfile (src, dest)
47 s = os.system('lilypond -dsafe -dbackend=svg -o /tmp/lsrtest ' + dest)
52 file=open("lsr-unsafe.txt", 'w')
58 print "Unsafe files printed in lsr-unsafe.txt: CHECK MANUALLY!"
59 print " (probably with xargs git-diff < lsr-unsafe.txt )"