Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4c9381

Browse files
committed
Copy .exp files to mwerks project directory too.
1 parent 3ba03b2 commit b4c9381

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

Mac/scripts/binhextree.py

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
#
55
# Jack Jansen, CWI, August 1995.
66
#
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-
#
127

138
import os
149
import binhex
@@ -138,11 +133,37 @@ def copycwproject(path, name):
138133
else:
139134
project_files[creator] = [fss]
140135

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)
141161

142162
extensions = [
143163
('.rsrc', binhexit),
144164
('.gif', binhexit),
145-
('.µ', copycwproject)
165+
('.µ', copycwproject),
166+
('.µ.exp', copycwexpfile)
146167
]
147168

148169
def walker(arg, top, names):

0 commit comments

Comments
 (0)