[Python-checkins] python/dist/src/Mac/OSX fixversions.py, NONE, 1.1.2.1 README, 1.11, 1.11.8.1

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Thu Jul 15 23:32:48 CEST 2004


Update of /cvsroot/python/python/dist/src/Mac/OSX
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28994
Modified Files:
 Tag: release23-maint
	README 
Added Files:
 Tag: release23-maint
	fixversions.py 
Log Message:
Imported fixversions.py and the note referring to it from 2.4.
--- NEW FILE: fixversions.py ---
"""fixversions - Fix version numbers in .plist files to match current
python version and date"""
import sys
import os
import time
import plistlib
SHORTVERSION = "%d.%d" % (sys.version_info[0], sys.version_info[1])
if sys.version_info[2]:
	SHORTVERSION = SHORTVERSION + ".%d" % sys.version_info[2]
if sys.version_info[3] != 'final':
	SHORTVERSION = SHORTVERSION + "%s%d" % (sys.version_info[3], sys.version_info[4])
COPYRIGHT = "(c) %d Python Software Foundation." % time.gmtime()[0]
LONGVERSION = SHORTVERSION + ", " + COPYRIGHT
def fix(file):
	plist = plistlib.Plist.fromFile(file)
	changed = False
	if plist.has_key("CFBundleGetInfoString") and \
			plist["CFBundleGetInfoString"] != LONGVERSION:
		plist["CFBundleGetInfoString"] = LONGVERSION
		changed = True
	if plist.has_key("CFBundleLongVersionString") and \
			plist["CFBundleLongVersionString"] != LONGVERSION:
		plist["CFBundleLongVersionString"] = LONGVERSION
		changed = True
	if plist.has_key("NSHumanReadableCopyright") and \
			plist["NSHumanReadableCopyright"] != COPYRIGHT:
		plist["NSHumanReadableCopyright"] = COPYRIGHT
		changed = True
	if plist.has_key("CFBundleVersion") and \
			plist["CFBundleVersion"] != SHORTVERSION:
		plist["CFBundleVersion"] = SHORTVERSION
		changed = True
	if plist.has_key("CFBundleShortVersionString") and \
			plist["CFBundleShortVersionString"] != SHORTVERSION:
		plist["CFBundleShortVersionString"] = SHORTVERSION
		changed = True
	if changed:
		os.rename(file, file + '~')
		plist.write(file)
		
def main():
	if len(sys.argv) < 2:
		print "Usage: %s plistfile ..." % sys.argv[0]
		print "or: %s -a fix standard Python plist files"
		sys.exit(1)
	if sys.argv[1] == "-a":
		files = [
			"../OSXResources/app/Info.plist",
			"../OSXResources/framework/version.plist",
			"../Tools/IDE/PackageManager.plist",
			"../Tools/IDE/PythonIDE.plist",
			"../scripts/BuildApplet.plist"
		]
		if not os.path.exists(files[0]):
			print "%s -a must be run from Mac/OSX directory"
			sys.exit(1)
	else:
		files = sys.argv[1:]
	for file in files:
		fix(file)
	sys.exit(0)
	
if __name__ == "__main__":
	main()
	
Index: README
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/OSX/README,v
retrieving revision 1.11
retrieving revision 1.11.8.1
diff -C2 -d -r1.11 -r1.11.8.1
*** README	20 Jun 2003 15:14:08 -0000	1.11
--- README	15 Jul 2004 21:32:45 -0000	1.11.8.1
***************
*** 120,123 ****
--- 120,127 ----
 -----------------------------------------
 
+ First go to Mac/OSX and run "python fixversions.py -a" with the Python
+ you are going to distribute. This will fix the version numbers and copyright
+ strings in the various Info.plist files.
+ 
 Go to the Mac/OSX/Dist directory. There you find a script "build" that
 does all the work: it configures and builds a framework Python, installs
***************
*** 157,159 ****
 files.
 
! 	Jack Jansen, Jack.Jansen at cwi.nl, 20-Jun-2003.
\ No newline at end of file
--- 161,163 ----
 files.
 
! 	Jack Jansen, Jack.Jansen at cwi.nl, 15-Jul-2004.
\ No newline at end of file


More information about the Python-checkins mailing list

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