]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/makelsr.py
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / buildscripts / makelsr.py
1 #!/usr/bin/python
2 import sys
3 import os
4 import os.path
5 import shutil
6
7 # 'expressive' not available yet
8 dirs = ['ancient','chords','connecting','contemporary','expressive','guitar','parts','repeats','spacing','staff','text','vocal']
9 notsafe=[]
10
11 try:
12         in_dir = sys.argv[1]
13 except:
14         print "Please specify input_file."
15         sys.exit()
16
17 for dir in dirs:
18         srcdir = os.path.join (in_dir, dir)
19         destdir = os.path.join ('input', 'lsr', dir)
20         if not(os.path.isdir(destdir)):
21                 print "Please run this script from the head of the source tree,"
22                 print "  and/or check that you have the right categories."
23                 sys.exit()
24
25         file_names = os.listdir (destdir)
26         for file in file_names:
27                 if (file.endswith ('.ly')):
28                         if (file[:3] != 'AAA'):
29                                 os.remove( os.path.join(destdir,file) )
30
31         file_names = os.listdir (in_dir + dir)
32         for file in file_names:
33                 src = os.path.join (srcdir, file)
34                 dest = os.path.join (destdir, file)
35                 shutil.copyfile (src, dest)
36                 s = os.system('lilypond -dsafe -dbackend=svg -o /tmp/lsrtest ' + dest)
37                 if s:
38                         notsafe.append(dest)
39                         #raise 'Failed'
40
41 file=open("lsr-unsafe.txt", 'w')
42 for s in notsafe:
43         file.write(s+'\n')
44 file.close()
45 print
46 print
47 print "Unsafe files printed in lsr-unsafe.txt: CHECK MANUALLY!"
48 print "  (probably with  xargs git-diff < lsr-unsafe.txt  )"
49 print
50
51