11import sys
2-
32import py2app
43
54__all__ = ["infoPlistDict" ]
65
76
8- def infoPlistDict (CFBundleExecutable , plist = None ):
9- if plist is None :
10- plist = {}
11-
7+ def infoPlistDict (CFBundleExecutable , plist = {}):
128 CFBundleExecutable = CFBundleExecutable
139 version = sys .version [:3 ]
14- pdict = {
15- " CFBundleDevelopmentRegion" : "English" ,
16- " CFBundleDisplayName" : plist .get ("CFBundleName" , CFBundleExecutable ),
17- " CFBundleExecutable" : CFBundleExecutable ,
18- " CFBundleIconFile" : CFBundleExecutable ,
19- " CFBundleIdentifier" : "org.pythonmac.unspecified.%s"
10+ pdict = dict (
11+ CFBundleDevelopmentRegion = "English" ,
12+ CFBundleDisplayName = plist .get ("CFBundleName" , CFBundleExecutable ),
13+ CFBundleExecutable = CFBundleExecutable ,
14+ CFBundleIconFile = CFBundleExecutable ,
15+ CFBundleIdentifier = "org.pythonmac.unspecified.%s"
2016 % ("" .join (CFBundleExecutable .split ()),),
21- " CFBundleInfoDictionaryVersion" : "6.0" ,
22- " CFBundleName" : CFBundleExecutable ,
23- " CFBundlePackageType" : "APPL" ,
24- " CFBundleShortVersionString" : plist .get ("CFBundleVersion" , "0.0" ),
25- " CFBundleSignature" : "????" ,
26- " CFBundleVersion" : "0.0" ,
27- " LSHasLocalizedDisplayName" : False ,
28- " NSAppleScriptEnabled" : False ,
29- " NSHumanReadableCopyright" : "Copyright not specified" ,
30- " NSMainNibFile=" : "MainMenu" ,
31- " NSPrincipalClass" : "NSApplication" ,
32- " PyMainFileNames" : ["__boot__" ],
33- " PyResourcePackages" : [],
34- " PyRuntimeLocations" : [
17+ CFBundleInfoDictionaryVersion = "6.0" ,
18+ CFBundleName = CFBundleExecutable ,
19+ CFBundlePackageType = "APPL" ,
20+ CFBundleShortVersionString = plist .get ("CFBundleVersion" , "0.0" ),
21+ CFBundleSignature = "????" ,
22+ CFBundleVersion = "0.0" ,
23+ LSHasLocalizedDisplayName = False ,
24+ NSAppleScriptEnabled = False ,
25+ NSHumanReadableCopyright = "Copyright not specified" ,
26+ NSMainNibFile = "MainMenu" ,
27+ NSPrincipalClass = "NSApplication" ,
28+ PyMainFileNames = ["__boot__" ],
29+ PyResourcePackages = [],
30+ PyRuntimeLocations = [
3531 (s % version )
3632 for s in [
3733 (
@@ -44,16 +40,21 @@ def infoPlistDict(CFBundleExecutable, plist=None):
4440 "/System/Library/Frameworks/Python.framework/Versions/%s/Python" ,
4541 ]
4642 ],
47- }
43+ )
4844 pdict .update (plist )
4945 pythonInfo = pdict .setdefault ("PythonInfoDict" , {})
5046 pythonInfo .update (
51- {
52- " PythonLongVersion" : sys .version ,
53- " PythonShortVersion" : sys .version [:3 ],
54- " PythonExecutable" : sys .executable ,
55- }
47+ dict (
48+ PythonLongVersion = sys .version ,
49+ PythonShortVersion = sys .version [:3 ],
50+ PythonExecutable = sys .executable ,
51+ )
5652 )
5753 py2appInfo = pythonInfo .setdefault ("py2app" , {})
58- py2appInfo .update ({"version" : py2app .__version__ , "template" : "app" })
54+ py2appInfo .update (
55+ dict (
56+ version = py2app .__version__ ,
57+ template = "app" ,
58+ )
59+ )
5960 return pdict
0 commit comments