]> 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
10 try:
11         in_dir = sys.argv[1]
12 except:
13         print "Please specify input_file."
14         sys.exit()
15
16 for dir in dirs:
17         srcdir = os.path.join (in_dir, dir)
18         destdir = os.path.join ('input', 'lsr', dir)
19         if not(os.path.isdir(destdir)):
20                 print "Please run this script from the head of the source tree,"
21                 print "  and/or check that you have the right categories."
22                 sys.exit()
23
24         file_names = os.listdir (destdir)
25         for file in file_names:
26                 if (file.endswith ('.ly')):
27                         if (file[:3] != 'AAA'):
28                                 os.remove( os.path.join(destdir,file) )
29
30         file_names = os.listdir (in_dir + dir)
31         for file in file_names:
32                 src = os.path.join (srcdir, file)
33                 dest = os.path.join (destdir, file)
34                 shutil.copyfile (src, dest)
35