mirror of
https://github.com/python/cpython.git
synced 2025-12-07 17:57:56 +00:00
Handle .icns and .plist files for applets.
Also, for now (until we learn to parse .plist files) we make a special case for the IDE, setting the creator to "Pide".
This commit is contained in:
parent
96f9e0864a
commit
9aa8fd0b7d
1 changed files with 23 additions and 5 deletions
|
|
@ -268,7 +268,18 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
|
||||||
if shortname[-4:] == '.app':
|
if shortname[-4:] == '.app':
|
||||||
# Strip the .app suffix
|
# Strip the .app suffix
|
||||||
shortname = shortname[:-4]
|
shortname = shortname[:-4]
|
||||||
plistname = shortname + '.plist'
|
# And deduce the .plist and .icns names
|
||||||
|
plistname = None
|
||||||
|
icnsname = None
|
||||||
|
if rsrcname and rsrcname[-5:] == '.rsrc':
|
||||||
|
tmp = rsrcname[:-5]
|
||||||
|
plistname = tmp + '.plist'
|
||||||
|
if os.path.exists(plistname):
|
||||||
|
icnsname = tmp + '.icns'
|
||||||
|
if not os.path.exists(icnsname):
|
||||||
|
icnsname = None
|
||||||
|
else:
|
||||||
|
plistname = None
|
||||||
# Start with copying the .app framework
|
# Start with copying the .app framework
|
||||||
if not is_update:
|
if not is_update:
|
||||||
exceptlist = ["Contents/Info.plist",
|
exceptlist = ["Contents/Info.plist",
|
||||||
|
|
@ -277,10 +288,17 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
|
||||||
]
|
]
|
||||||
copyapptree(template, destname, exceptlist)
|
copyapptree(template, destname, exceptlist)
|
||||||
# Now either use the .plist file or the default
|
# Now either use the .plist file or the default
|
||||||
if plistname and os.path.exists(plistname):
|
if plistname:
|
||||||
shutil.copy2(plistname, os.path.join(destname, 'Contents/Info.plist'))
|
shutil.copy2(plistname, os.path.join(destname, 'Contents/Info.plist'))
|
||||||
# XXXX Wrong. This should be parsed from plist file
|
if icnsname:
|
||||||
# icnsname = 'PythonApplet.icns'
|
icnsdest = os.path.split(icnsname)[1]
|
||||||
|
icnsdest = os.path.join(destname,
|
||||||
|
os.path.join('Contents/Resources', icnsdest))
|
||||||
|
shutil.copy2(icnsname, icnsdest)
|
||||||
|
# XXXX Wrong. This should be parsed from plist file. Also a big hack:-)
|
||||||
|
if shortname == 'PythonIDE':
|
||||||
|
ownertype = 'Pide'
|
||||||
|
else:
|
||||||
ownertype = 'PytA'
|
ownertype = 'PytA'
|
||||||
# XXXX Should copy .icns file
|
# XXXX Should copy .icns file
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue