[Python-checkins] python/dist/src/Mac/Lib buildtools.py,1.19,1.20

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Sun, 10 Nov 2002 16:06:16 -0800


Update of /cvsroot/python/python/dist/src/Mac/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv7846

Modified Files:
	buildtools.py 
Log Message:
- Use imp to find appletrawmain.py in stead of hand-crafting the path
  to it.
- Allow for symlinks in the applet template.


Index: buildtools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Lib/buildtools.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** buildtools.py	7 Nov 2002 23:07:04 -0000	1.19
--- buildtools.py	11 Nov 2002 00:06:14 -0000	1.20
***************
*** 390,395 ****
  				progress.label('Creating __rawmain__.pyc')
  				progress.inc(0)
! 			rawsourcefile = os.path.join(sys.prefix, 'Mac', 'Lib', 'appletrawmain.py')
! 			rawsource = open(rawsourcefile, 'rU').read()
  			rawcode = compile(rawsource, rawsourcefile, 'exec')
  			writepycfile(rawcode, outputfilename)
--- 390,395 ----
  				progress.label('Creating __rawmain__.pyc')
  				progress.inc(0)
! 			rawsourcefp, rawsourcefile, d2 = imp.find_module('appletrawmain')
! 			rawsource = rawsourcefp.read()
  			rawcode = compile(rawsource, rawsourcefile, 'exec')
  			writepycfile(rawcode, outputfilename)
***************
*** 489,492 ****
--- 489,495 ----
  		if os.path.isdir(srcpath):
  			os.mkdir(dstpath)
+ 		elif os.path.islink(srcpath):
+ 			endpoint = os.readlink(srcpath)
+ 			os.symlink(endpoint, dstpath)
  		else:
  			if progress: