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