summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-03-29 23:44:37 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2002-03-29 23:44:37 (GMT)
commit9aa8fd0b7d71238e7c5380f05a0e73be36f34364 (patch)
tree642f3c3d7f698e064d93b91ad2e589291c4b1574 /Mac
parent96f9e0864a0f4ff4e7b5bb5541c26f8f651ca514 (diff)
downloadcpython-9aa8fd0b7d71238e7c5380f05a0e73be36f34364.zip
cpython-9aa8fd0b7d71238e7c5380f05a0e73be36f34364.tar.gz
cpython-9aa8fd0b7d71238e7c5380f05a0e73be36f34364.tar.bz2
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".
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Lib/buildtools.py28
1 files changed, 23 insertions, 5 deletions
diff --git a/Mac/Lib/buildtools.py b/Mac/Lib/buildtools.py
index 25f77e6..0eef5ac 100644
--- a/Mac/Lib/buildtools.py
+++ b/Mac/Lib/buildtools.py
@@ -268,7 +268,18 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
if shortname[-4:] == '.app':
# Strip the .app suffix
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
if not is_update:
exceptlist = ["Contents/Info.plist",
@@ -277,11 +288,18 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
]
copyapptree(template, destname, exceptlist)
# 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'))
- # XXXX Wrong. This should be parsed from plist file
- # icnsname = 'PythonApplet.icns'
- ownertype = 'PytA'
+ if icnsname:
+ 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'
# XXXX Should copy .icns file
else:
plistname = os.path.join(template, 'Contents/Resources/Applet-Info.plist')