]> 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 dirs = ['advanced','trick']
8
9 try:
10         in_dir = sys.argv[1]
11 except:
12         print "Please specify input_file."
13         exit
14
15 for dir in dirs:
16         srcdir = os.path.join (in_dir, dir)
17         destdir = os.path.join (os.getcwd(), 'lsr', dir)
18
19         file_names = os.listdir (destdir)
20         for file in file_names:
21                 if (file.endswith ('.ly')):
22                         if (file[:3] != 'AAA'):   # or whatever we use to denote the first file
23                                 os.remove( os.path.join(destdir,file) )
24
25         file_names = os.listdir (in_dir + dir)
26         for file in file_names:
27                 src = os.path.join (srcdir, file)
28                 dest = os.path.join (destdir, file)
29                 shutil.copyfile (src, dest)
30