|
4 | 4 | # |
5 | 5 | # Jack Jansen, CWI, August 1995. |
6 | 6 | # |
7 | | -# To do: |
8 | | -# - Also do project files (.µ and .Ü), after using AppleEvents to the |
9 | | -# various builders to clean the projects |
10 | | -# - Don't hexbin (and clean) if there exists a .hqx file that is newer. |
11 | | -# |
12 | 7 |
|
13 | 8 | import os |
14 | 9 | import binhex |
@@ -138,11 +133,37 @@ def copycwproject(path, name): |
138 | 133 | else: |
139 | 134 | project_files[creator] = [fss] |
140 | 135 |
|
| 136 | +def copycwexpfile(path, name): |
| 137 | + """Copy CW export file""" |
| 138 | + global project_files |
| 139 | + |
| 140 | + dstdir = os.path.join(TOP, CWDIR) |
| 141 | + if not os.path.exists(dstdir): |
| 142 | + print dstdir |
| 143 | + print 'No CW-project dir, skip', name |
| 144 | + return |
| 145 | + dstfile = os.path.join(dstdir, name) |
| 146 | + if dstfile[-6:] == '.µ.exp': |
| 147 | + dstfile = dstfile[:-6]+'.mu.exp' |
| 148 | + # Check that we're not in the dest directory |
| 149 | + if dstfile == path: |
| 150 | + return |
| 151 | + |
| 152 | + # If the destination doesn't exists or is older that the source |
| 153 | + # we copy and remember it |
| 154 | + |
| 155 | + if os.path.exists(dstfile) and \ |
| 156 | + os.stat(dstfile)[8] > os.stat(path)[8]: |
| 157 | + print 'Not copying', path,'- Up-to-date' |
| 158 | + else: |
| 159 | + print 'Copy', path |
| 160 | + macostools.copy(path, dstfile) |
141 | 161 |
|
142 | 162 | extensions = [ |
143 | 163 | ('.rsrc', binhexit), |
144 | 164 | ('.gif', binhexit), |
145 | | - ('.µ', copycwproject) |
| 165 | + ('.µ', copycwproject), |
| 166 | + ('.µ.exp', copycwexpfile) |
146 | 167 | ] |
147 | 168 |
|
148 | 169 | def walker(arg, top, names): |
|
0 commit comments