[Python-checkins] python/dist/src/Mac/scripts mkestrres.py,1.9,1.10

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
2003年2月06日 14:57:47 -0800


Update of /cvsroot/python/python/dist/src/Mac/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv21528
Modified Files:
	mkestrres.py 
Log Message:
Got rid of FSSpecs.
Index: mkestrres.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/scripts/mkestrres.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** mkestrres.py	22 Apr 2002 11:44:26 -0000	1.9
--- mkestrres.py	6 Feb 2003 22:57:44 -0000	1.10
***************
*** 2,6 ****
 
 import re
- import macfs
 import string
 from Carbon import Res
--- 2,5 ----
***************
*** 106,150 ****
 def main():
 	dict = {}
! 	fss, ok = macfs.PromptGetFile("Where is GUSI sys/errno.h?")
! 	if not ok: return
! 	fp = open(fss.as_pathname())
! 	parse_errno_h(fp, dict)
! 	fp.close()
 	
! 	fss, ok = macfs.PromptGetFile("Select cerrno (MSL) or cancel")
! 	if not ok: return
! 	fp = open(fss.as_pathname())
! 	parse_errno_h(fp, dict)
! 	fp.close()
 	
! 	fss, ok = macfs.PromptGetFile("Where is MacErrors.h?")
! 	if not ok: return
! 	fp = open(fss.as_pathname())
! 	parse_errors_h(fp, dict)
! 	fp.close()
 	
! 	fss, ok = macfs.PromptGetFile("Where is mkestrres-MacErrors.h?")
! 	if not ok: return
! 	fp = open(fss.as_pathname())
! 	parse_errors_h(fp, dict)
! 	fp.close()
 	
 	if not dict:
 		return
 		
! 	fss, ok = macfs.StandardPutFile("Resource output file?", "errors.rsrc")
! 	if ok:
 		writeestr(fss, dict)
 	
! 	fss, ok = macfs.StandardPutFile("Python output file?", "macerrors.py")
! 	if ok:
! 		fp = open(fss.as_pathname(), "w")
 		writepython(fp, dict)
 		fp.close()
 		fss.SetCreatorType('Pyth', 'TEXT')
 
! 	fss, ok = macfs.StandardPutFile("Text output file?", "errors.txt")
! 	if ok:
! 		fp = open(fss.as_pathname(), "w")
 		
 		k = dict.keys()
--- 105,149 ----
 def main():
 	dict = {}
! 	pathname = EasyDialogs.AskFileForOpen(message="Where is GUSI sys/errno.h?")
! 	if pathname:
! 		fp = open(pathname)
! 		parse_errno_h(fp, dict)
! 		fp.close()
 	
! 	pathname = EasyDialogs.AskFileForOpen(message="Select cerrno (MSL) or cancel")
! 	if pathname:
! 		fp = open(pathname)
! 		parse_errno_h(fp, dict)
! 		fp.close()
 	
! 	pathname = EasyDialogs.AskFileForOpen(message="Where is MacErrors.h?")
! 	if pathname:
! 		fp = open(pathname)
! 		parse_errors_h(fp, dict)
! 		fp.close()
 	
! 	pathname = EasyDialogs.AskFileForOpen(message="Where is mkestrres-MacErrors.h?")
! 	if pathname:
! 		fp = open(pathname)
! 		parse_errors_h(fp, dict)
! 		fp.close()
 	
 	if not dict:
 		return
 		
! 	pathname = EasyDialogs.AskFileForSave(message="Resource output file?", savedFileName="errors.rsrc")
! 	if pathname:
 		writeestr(fss, dict)
 	
! 	pathname = EasyDialogs.AskFileForSave(message="Python output file?", savedFileName="macerrors.py")
! 	if pathname:
! 		fp = open(pathname, "w")
 		writepython(fp, dict)
 		fp.close()
 		fss.SetCreatorType('Pyth', 'TEXT')
 
! 	pathname = EasyDialogs.AskFileForSave(message="Text output file?", savedFileName="errors.txt")
! 	if pathname:
! 		fp = open(pathname, "w")
 		
 		k = dict.keys()

AltStyle によって変換されたページ (->オリジナル) /