- Use imp to find appletrawmain.py in stead of hand-crafting the path
to it.
- Allow for symlinks in the applet template.
diff --git a/Mac/Lib/buildtools.py b/Mac/Lib/buildtools.py
index 163f19a..68a6614 100644
--- a/Mac/Lib/buildtools.py
+++ b/Mac/Lib/buildtools.py
@@ -389,8 +389,8 @@
if progress:
progress.label('Creating __rawmain__.pyc')
progress.inc(0)
- rawsourcefile = os.path.join(sys.prefix, 'Mac', 'Lib', 'appletrawmain.py')
- rawsource = open(rawsourcefile, 'rU').read()
+ rawsourcefp, rawsourcefile, d2 = imp.find_module('appletrawmain')
+ rawsource = rawsourcefp.read()
rawcode = compile(rawsource, rawsourcefile, 'exec')
writepycfile(rawcode, outputfilename)
@@ -488,6 +488,9 @@
dstpath = os.path.join(dsttree, this)
if os.path.isdir(srcpath):
os.mkdir(dstpath)
+ elif os.path.islink(srcpath):
+ endpoint = os.readlink(srcpath)
+ os.symlink(endpoint, dstpath)
else:
if progress:
progress.label('Copy '+this)