Commit eb342298 authored by Jack Jansen's avatar Jack Jansen

- Use imp to find appletrawmain.py in stead of hand-crafting the path

  to it.
- Allow for symlinks in the applet template.
parent 7d996a2b
...@@ -389,8 +389,8 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update ...@@ -389,8 +389,8 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
if progress: if progress:
progress.label('Creating __rawmain__.pyc') progress.label('Creating __rawmain__.pyc')
progress.inc(0) progress.inc(0)
rawsourcefile = os.path.join(sys.prefix, 'Mac', 'Lib', 'appletrawmain.py') rawsourcefp, rawsourcefile, d2 = imp.find_module('appletrawmain')
rawsource = open(rawsourcefile, 'rU').read() rawsource = rawsourcefp.read()
rawcode = compile(rawsource, rawsourcefile, 'exec') rawcode = compile(rawsource, rawsourcefile, 'exec')
writepycfile(rawcode, outputfilename) writepycfile(rawcode, outputfilename)
...@@ -488,6 +488,9 @@ def copyapptree(srctree, dsttree, exceptlist=[], progress=None): ...@@ -488,6 +488,9 @@ def copyapptree(srctree, dsttree, exceptlist=[], progress=None):
dstpath = os.path.join(dsttree, this) dstpath = os.path.join(dsttree, this)
if os.path.isdir(srcpath): if os.path.isdir(srcpath):
os.mkdir(dstpath) os.mkdir(dstpath)
elif os.path.islink(srcpath):
endpoint = os.readlink(srcpath)
os.symlink(endpoint, dstpath)
else: else:
if progress: if progress:
progress.label('Copy '+this) progress.label('Copy '+this)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment