Skip to content

Commit

Permalink
Issue #281: App won't launch on macOS 10.9 or 10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldoussoren committed Sep 15, 2020
1 parent 8ca33e3 commit c66bec5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
2 changes: 2 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ py2app 0.22
* #299: Fix build error when building with the copy of Python 3 shipped
with Xcode.

* #281: Generated bundle doesn't work on macOS 10.9 and 10.10.

py2app 0.21
-----------

Expand Down
65 changes: 33 additions & 32 deletions py2app/apptemplate/plist_template.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
import sys

import py2app

__all__ = ["infoPlistDict"]


def infoPlistDict(CFBundleExecutable, plist=None):
if plist is None:
plist = {}

def infoPlistDict(CFBundleExecutable, plist={}):
CFBundleExecutable = CFBundleExecutable
version = sys.version[:3]
pdict = {
"CFBundleDevelopmentRegion": "English",
"CFBundleDisplayName": plist.get("CFBundleName", CFBundleExecutable),
"CFBundleExecutable": CFBundleExecutable,
"CFBundleIconFile": CFBundleExecutable,
"CFBundleIdentifier": "org.pythonmac.unspecified.%s"
pdict = dict(
CFBundleDevelopmentRegion="English",
CFBundleDisplayName=plist.get("CFBundleName", CFBundleExecutable),
CFBundleExecutable=CFBundleExecutable,
CFBundleIconFile=CFBundleExecutable,
CFBundleIdentifier="org.pythonmac.unspecified.%s"
% ("".join(CFBundleExecutable.split()),),
"CFBundleInfoDictionaryVersion": "6.0",
"CFBundleName": CFBundleExecutable,
"CFBundlePackageType": "APPL",
"CFBundleShortVersionString": plist.get("CFBundleVersion", "0.0"),
"CFBundleSignature": "????",
"CFBundleVersion": "0.0",
"LSHasLocalizedDisplayName": False,
"NSAppleScriptEnabled": False,
"NSHumanReadableCopyright": "Copyright not specified",
"NSMainNibFile=": "MainMenu",
"NSPrincipalClass": "NSApplication",
"PyMainFileNames": ["__boot__"],
"PyResourcePackages": [],
"PyRuntimeLocations": [
CFBundleInfoDictionaryVersion="6.0",
CFBundleName=CFBundleExecutable,
CFBundlePackageType="APPL",
CFBundleShortVersionString=plist.get("CFBundleVersion", "0.0"),
CFBundleSignature="????",
CFBundleVersion="0.0",
LSHasLocalizedDisplayName=False,
NSAppleScriptEnabled=False,
NSHumanReadableCopyright="Copyright not specified",
NSMainNibFile="MainMenu",
NSPrincipalClass="NSApplication",
PyMainFileNames=["__boot__"],
PyResourcePackages=[],
PyRuntimeLocations=[
(s % version)
for s in [
(
Expand All @@ -44,16 +40,21 @@ def infoPlistDict(CFBundleExecutable, plist=None):
"/System/Library/Frameworks/Python.framework/Versions/%s/Python",
]
],
}
)
pdict.update(plist)
pythonInfo = pdict.setdefault("PythonInfoDict", {})
pythonInfo.update(
{
"PythonLongVersion": sys.version,
"PythonShortVersion": sys.version[:3],
"PythonExecutable": sys.executable,
}
dict(
PythonLongVersion=sys.version,
PythonShortVersion=sys.version[:3],
PythonExecutable=sys.executable,
)
)
py2appInfo = pythonInfo.setdefault("py2app", {})
py2appInfo.update({"version": py2app.__version__, "template": "app"})
py2appInfo.update(
dict(
version=py2app.__version__,
template="app",
)
)
return pdict

0 comments on commit c66bec5

Please sign in to comment.