summaryrefslogtreecommitdiffstats
path: root/Mac/Lib/buildtools.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-11-07 23:07:05 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2002-11-07 23:07:05 (GMT)
commitdde800ec4ee704d0c4d6d0b60d74e72e0ea834d8 (patch)
tree329e6e0e43d662232eb8e3ccc1b5dc22f719bdb3 /Mac/Lib/buildtools.py
parent430b1563dde73ae1dc8f2379bdd29a0b0e5c82eb (diff)
downloadcpython-dde800ec4ee704d0c4d6d0b60d74e72e0ea834d8.zip
cpython-dde800ec4ee704d0c4d6d0b60d74e72e0ea834d8.tar.gz
cpython-dde800ec4ee704d0c4d6d0b60d74e72e0ea834d8.tar.bz2
Got rid of the python.rsrc resource file. The error message strings and
dialogs are now stored in Mac/Lib, and loaded on demand through macresource. Not only does this simplify a MacPython based on Apple's Python, but it also makes Mac error codes come out symbolically when running command line python (if you have Mac/Lib in your path). The resource files are copied from Mac/Resources. The old ones will disappear after the OS9 build procedure has been adjusted.
Diffstat (limited to 'Mac/Lib/buildtools.py')
-rw-r--r--Mac/Lib/buildtools.py57
1 files changed, 15 insertions, 42 deletions
diff --git a/Mac/Lib/buildtools.py b/Mac/Lib/buildtools.py
index a02c609..163f19a 100644
--- a/Mac/Lib/buildtools.py
+++ b/Mac/Lib/buildtools.py
@@ -353,58 +353,31 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
ofp.close()
- if progress:
- progress.label("Copy resources...")
- progress.set(20)
- resfilename = 'python.rsrc' # XXXX later: '%s.rsrc' % shortname
- try:
- output = Res.FSOpenResourceFile(
- os.path.join(destname, 'Contents', 'Resources', resfilename),
- u'', WRITE)
- except MacOS.Error:
- fsr, dummy = Res.FSCreateResourceFile(
- os.path.join(destname, 'Contents', 'Resources'),
- unicode(resfilename), '')
- output = Res.FSOpenResourceFile(fsr, u'', WRITE)
-
# Copy the resources from the target specific resource template, if any
typesfound, ownertype = [], None
try:
input = macresource.open_pathname(rsrcname)
except (MacOS.Error, ValueError):
- pass
if progress:
progress.inc(50)
else:
+ if progress:
+ progress.label("Copy resources...")
+ progress.set(20)
+ resfilename = 'python.rsrc' # XXXX later: '%s.rsrc' % shortname
+ try:
+ output = Res.FSOpenResourceFile(
+ os.path.join(destname, 'Contents', 'Resources', resfilename),
+ u'', WRITE)
+ except MacOS.Error:
+ fsr, dummy = Res.FSCreateResourceFile(
+ os.path.join(destname, 'Contents', 'Resources'),
+ unicode(resfilename), '')
+ output = Res.FSOpenResourceFile(fsr, u'', WRITE)
+
typesfound, ownertype = copyres(input, output, [], 0, progress)
Res.CloseResFile(input)
-
- # Check which resource-types we should not copy from the template
- skiptypes = []
-## if 'vers' in typesfound: skiptypes.append('vers')
-## if 'SIZE' in typesfound: skiptypes.append('SIZE')
-## if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4',
-## 'icl8', 'ics4', 'ics8', 'ICN#', 'ics#']
-## if not copy_codefragment:
-## skiptypes.append('cfrg')
-## skipowner = (ownertype <> None)
-
- # Copy the resources from the template
-
- input = Res.FSOpenResourceFile(
- os.path.join(template, 'Contents', 'Resources', 'python.rsrc'), u'', READ)
- if progress:
- progress.label("Copy standard resources...")
- progress.inc(0)
-## dummy, tmplowner = copyres(input, output, skiptypes, 1, progress)
- dummy, tmplowner = copyres(input, output, skiptypes, 1, None)
-
- Res.CloseResFile(input)
-## if ownertype == None:
-## raise BuildError, "No owner resource found in either resource file or template"
- # Make sure we're manipulating the output resource file now
-
- Res.CloseResFile(output)
+ Res.CloseResFile(output)
if code:
if raw: