]> granicus.if.org Git - python/commitdiff
Replaced OpenResFile calls with FSpOpenResFile calls (which are carbon-compatible).
authorJack Jansen <jack.jansen@cwi.nl>
Tue, 20 Jun 2000 21:59:25 +0000 (21:59 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Tue, 20 Jun 2000 21:59:25 +0000 (21:59 +0000)
14 files changed:
Mac/Lib/cfmfile.py
Mac/Lib/test/tlist_dialog.py
Mac/Tools/CGI/BuildCGIApplet.py
Mac/Tools/IDE/BuildIDE.py
Mac/Tools/IDE/PyEdit.py
Mac/Tools/macfreeze/macfreezegui.py
Mac/Tools/macfreeze/macgen_bin.py
Mac/Tools/twit/mactwit_app.py
Mac/Tools/twit/mactwit_browser.py
Mac/scripts/BuildApplication.py
Mac/scripts/EditPythonPrefs.py
Mac/scripts/MkDistr_ui.py
Mac/scripts/RunLibScript.py
Mac/scripts/fullbuild.py

index 27c0f1c17f5f420c5f7689549f0195b442ca6720..cef28fe18c29a944202e33b100e21c0e7c07a11d 100644 (file)
@@ -34,7 +34,7 @@ def mergecfmfiles(srclist, dst, architecture = 'fat'):
                dst = dst.as_pathname()
        
        dstfile = open(dst, "wb")
-       rf = Res.OpenResFile(dst)
+       rf = Res.FSpOpenResFile(dst, 3)
        try:
                dstcfrg = CfrgResource()
                for src in srclist:
@@ -64,7 +64,7 @@ class CfrgResource:
                self.path = path
                if path is not None and os.path.exists(path):
                        currentresref = Res.CurResFile()
-                       resref = Res.OpenResFile(path)
+                       resref = Res.FSpOpenResFile(path, 1)
                        Res.UseResFile(resref)
                        try:
                                try:
index cacfd4772c1d5b218d6b93dcbc877210cbe8f327..d27a61cb1bdcf290f96cc34fbea45d55a3ce1fcb 100644 (file)
@@ -71,7 +71,7 @@ def dodialog(items):
 
 def test():
        import os, sys
-       Res.OpenResFile('tlist_dialog.rsrc')
+       Res.FSpOpenResFile('tlist_dialog.rsrc', 1)
        dodialog(os.listdir(':'))
        sys.exit(1)
 
index 8c9a633f1a00f09bc0c82591e62d188620ed87e1..c94eca954eb9f0baed9e7a6a2376565b2fa7246a 100644 (file)
@@ -64,7 +64,7 @@ def mkcgifilename(filename):
 def buildone(template, wrapper, src, dst):
        buildtools.process(template, wrapper, dst, 1)
        # write source as a PYC resource into dst
-       ref = Res.OpenResFile(dst)
+       ref = Res.FSpOpenResFile(dst, 1)
        try:
                Res.UseResFile(ref)
                py_resource.frompyfile(src, "CGI_MAIN", preload=1)
index 82a06367e22f4601a3bc882d2f4d59fa68cba26a..942670acfc49de57e52ade316aca6c992149e37d 100644 (file)
@@ -19,7 +19,7 @@ dstfilename = os.path.join(sys.exec_prefix, "Python IDE")
 
 buildtools.process(template, mainfilename, dstfilename, 1)
 
-targetref = Res.OpenResFile(dstfilename)
+targetref = Res.FSpOpenResFile(dstfilename, 3)
 Res.UseResFile(targetref)
 
 files = os.listdir(ide_home)
@@ -36,6 +36,6 @@ for name in files:
                ispackage=0)
 
 # add W resources
-wresref = Res.OpenResFile(os.path.join(ide_home, "Widgets.rsrc"))
+wresref = Res.FSpOpenResFile(os.path.join(ide_home, "Widgets.rsrc"), 1)
 buildtools.copyres(wresref, targetref, [], 0)
 
index bff5baf534cdfb366a56aca92e1b5ac0c6d94540..0a0773e4fab25b1ce84fe5429663aef4e8398985 100644 (file)
@@ -114,7 +114,7 @@ class Editor(W.Window):
        
        def readwindowsettings(self):
                try:
-                       resref = Res.OpenResFile(self.path)
+                       resref = Res.FSpOpenResFile(self.path, 1)
                except Res.Error:
                        return
                try:
@@ -127,10 +127,10 @@ class Editor(W.Window):
                
        def writewindowsettings(self):
                try:
-                       resref = Res.OpenResFile(self.path)
+                       resref = Res.FSpOpenResFile(self.path, 3)
                except Res.Error:
                        Res.CreateResFile(self.path)
-                       resref = Res.OpenResFile(self.path)
+                       resref = Res.FSpOpenResFile(self.path, 3)
                try:
                        data = Res.Resource(marshal.dumps(self.settings))
                        Res.UseResFile(resref)
index bd70c00d06852962f24c24b277c5f9139cd30b33..c3311b7c30f9ecfac3783e1c6ee5754f75b9a80d 100644 (file)
@@ -60,7 +60,7 @@ def dialog(script=None):
                d = None
        if d == None:
                try:
-                       Res.OpenResFile('macfreeze.rsrc')
+                       Res.FSpOpenResFile('macfreeze.rsrc', 1)
                except Res.Error:
                        d = None
                else:
index 04260ed354672f7f4b66ae36db7f497b164b7c4e..9b653cba2fd48ddde45898093a5421927d3c4a27 100644 (file)
@@ -39,7 +39,7 @@ def generate(input, output, module_dict=None, architecture='fat', debug=0):
        print 'Adding "__main__"'
        buildtools.process(applettemplatepath, input, output, 0)
        
-       outputref = Res.OpenResFile(output)
+       outputref = Res.FSpOpenResFile(output, 3)
        try:
                Res.UseResFile(outputref)
                
@@ -171,10 +171,10 @@ def makefilenames(name):
 def copyres(input, output, *args, **kwargs):
        openedin = openedout = 0
        if type(input) == types.StringType:
-               input = Res.OpenResFile(input)
+               input = Res.FSpOpenResFile(input, 1)
                openedin = 1
        if type(output) == types.StringType:
-               output = Res.OpenResFile(output)
+               output = Res.FSpOpenResFile(output, 3)
                openedout = 1
        try:
                apply(buildtools.copyres, (input, output) + args, kwargs)
index 4b8433a718512ef40eeefff560938998f3377c1f..8c568dfe8aaa0afb4894f156031f9d8afed29ac8 100644 (file)
@@ -260,7 +260,7 @@ def Initialize():
                dummy = Res.GetResource('DLOG', ID_MODULES)
        except Res.Error:
                try:
-                       Res.OpenResFile("Twit.rsrc")
+                       Res.FSpOpenResFile("Twit.rsrc", 1)
                except Res.Error, arg:
                        EasyDialogs.Message("Cannot open Twit.rsrc: "+arg[1])
                        sys.exit(1)
index a8968ca4b0e8ba54f421c19b1b468a1cb74c9562..070de43839cf172d38012d5fe54c6c9c379b5ba1 100644 (file)
@@ -61,7 +61,7 @@ def Initialize():
                ourparentdir = os.path.split(openresfile.func_code.co_filename)[0]
                os.chdir(ourparentdir)          
                try:
-                       Res.OpenResFile("mactwit_browse.rsrc")
+                       Res.FSpOpenResFile("mactwit_browse.rsrc", 1)
                except Res.Error, arg:
                        EasyDialogs.Message("Cannot open mactwit_browse.rsrc: "+arg[1])
                        sys.exit(1)
index dbfe5158a1864d6330344b41bbe44e04d01830e6..6f55eb1cb1619b4b84e75eae148bc0204b7d7193 100644 (file)
@@ -38,7 +38,7 @@ GEN68K_BUTTON = 6
 try:
        Res.GetResource('DITL', DLG_ID)
 except Res.Error:
-       Res.OpenResFile("BuildApplication.rsrc")
+       Res.FSpOpenResFile("BuildApplication.rsrc", 1)
 else:
        pass # we're an applet
 
index 44d89a63153ca17a09418722ce03d3d2905a7e51..d9f30f103ccb096e77152b4b72a59deb76a9b045 100644 (file)
@@ -170,7 +170,7 @@ def edit_applet(name):
 
 def main():
        try:
-               h = OpenResFile('EditPythonPrefs.rsrc')
+               h = FSpOpenResFile('EditPythonPrefs.rsrc', 1)
        except Res.Error:
                pass    # Assume we already have acces to our own resource
        
index f0be72b1424c055668ab31b003ec6349ee8c61c6..6b39aaa4b9e832c1d554bec73af582f031f92faf 100644 (file)
@@ -321,7 +321,7 @@ def GetType():
                        
 def InitUI():
        """Initialize stuff needed by UI (a resource file)"""
-       Res.OpenResFile('MkDistr.rsrc')
+       Res.FSpOpenResFile('MkDistr.rsrc', 1)
 
 class _testerhelp:
        def __init__(self, which):
@@ -340,7 +340,7 @@ class _testerhelp:
 class _test:
        def __init__(self):
                import sys
-               Res.OpenResFile('MkDistr.rsrc')
+               Res.FSpOpenResFile('MkDistr.rsrc', 1)
                self.inc = _testerhelp('include')
                self.exc = _testerhelp('exclude')
                self.ui = MkDistrUI(self)
index 3a9ab7e056c94be07d655980ab53a19e7cd5b24c..362cb826c927a2fa3eee7aa46050108ccd68aedb 100644 (file)
@@ -85,7 +85,7 @@ def main():
        curdir = os.getcwd()
        import Res
        try:
-               Res.OpenResFile('RunLibScript.rsrc')
+               Res.FSpOpenResFile('RunLibScript.rsrc', 1)
        except:
                pass # Assume we're an applet already
        name, argv, stdin, stdout, wdir, pause = interact()
index 11a6b8b07de66a4ae24526987cd682f4763f6fc2..50954467a0ec0469cf0ba0da15d073961d70bead 100644 (file)
@@ -270,7 +270,7 @@ def incbuildno(filename):
                                
 def main():
        try:
-               h = Res.OpenResFile('fullbuild.rsrc')
+               h = Res.FSpOpenResFile('fullbuild.rsrc', 1)
        except Res.Error:
                pass    # Assume we already have acces to our own resource