From d13c3854629d605236c4d7cc8589a647b069207e Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 20 Jun 2000 21:59:25 +0000 Subject: Replaced OpenResFile calls with FSpOpenResFile calls (which are carbon-compatible). --- Mac/Lib/cfmfile.py | 4 ++-- Mac/Lib/test/tlist_dialog.py | 2 +- Mac/Tools/CGI/BuildCGIApplet.py | 2 +- Mac/Tools/IDE/BuildIDE.py | 4 ++-- Mac/Tools/IDE/PyEdit.py | 6 +++--- Mac/Tools/macfreeze/macfreezegui.py | 2 +- Mac/Tools/macfreeze/macgen_bin.py | 6 +++--- Mac/Tools/twit/mactwit_app.py | 2 +- Mac/Tools/twit/mactwit_browser.py | 2 +- Mac/scripts/BuildApplication.py | 2 +- Mac/scripts/EditPythonPrefs.py | 2 +- Mac/scripts/MkDistr_ui.py | 4 ++-- Mac/scripts/RunLibScript.py | 2 +- Mac/scripts/fullbuild.py | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Mac/Lib/cfmfile.py b/Mac/Lib/cfmfile.py index 27c0f1c..cef28fe 100644 --- a/Mac/Lib/cfmfile.py +++ b/Mac/Lib/cfmfile.py @@ -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: diff --git a/Mac/Lib/test/tlist_dialog.py b/Mac/Lib/test/tlist_dialog.py index cacfd47..d27a61c 100644 --- a/Mac/Lib/test/tlist_dialog.py +++ b/Mac/Lib/test/tlist_dialog.py @@ -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) diff --git a/Mac/Tools/CGI/BuildCGIApplet.py b/Mac/Tools/CGI/BuildCGIApplet.py index 8c9a633..c94eca9 100644 --- a/Mac/Tools/CGI/BuildCGIApplet.py +++ b/Mac/Tools/CGI/BuildCGIApplet.py @@ -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) diff --git a/Mac/Tools/IDE/BuildIDE.py b/Mac/Tools/IDE/BuildIDE.py index 82a0636..942670a 100644 --- a/Mac/Tools/IDE/BuildIDE.py +++ b/Mac/Tools/IDE/BuildIDE.py @@ -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) diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index bff5baf..0a0773e 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -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) diff --git a/Mac/Tools/macfreeze/macfreezegui.py b/Mac/Tools/macfreeze/macfreezegui.py index bd70c00..c3311b7 100644 --- a/Mac/Tools/macfreeze/macfreezegui.py +++ b/Mac/Tools/macfreeze/macfreezegui.py @@ -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: diff --git a/Mac/Tools/macfreeze/macgen_bin.py b/Mac/Tools/macfreeze/macgen_bin.py index 04260ed..9b653cb 100644 --- a/Mac/Tools/macfreeze/macgen_bin.py +++ b/Mac/Tools/macfreeze/macgen_bin.py @@ -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) diff --git a/Mac/Tools/twit/mactwit_app.py b/Mac/Tools/twit/mactwit_app.py index 4b8433a..8c568df 100644 --- a/Mac/Tools/twit/mactwit_app.py +++ b/Mac/Tools/twit/mactwit_app.py @@ -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) diff --git a/Mac/Tools/twit/mactwit_browser.py b/Mac/Tools/twit/mactwit_browser.py index a8968ca..070de43 100644 --- a/Mac/Tools/twit/mactwit_browser.py +++ b/Mac/Tools/twit/mactwit_browser.py @@ -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) diff --git a/Mac/scripts/BuildApplication.py b/Mac/scripts/BuildApplication.py index dbfe515..6f55eb1 100644 --- a/Mac/scripts/BuildApplication.py +++ b/Mac/scripts/BuildApplication.py @@ -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 diff --git a/Mac/scripts/EditPythonPrefs.py b/Mac/scripts/EditPythonPrefs.py index 44d89a6..d9f30f1 100644 --- a/Mac/scripts/EditPythonPrefs.py +++ b/Mac/scripts/EditPythonPrefs.py @@ -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 diff --git a/Mac/scripts/MkDistr_ui.py b/Mac/scripts/MkDistr_ui.py index f0be72b..6b39aaa 100644 --- a/Mac/scripts/MkDistr_ui.py +++ b/Mac/scripts/MkDistr_ui.py @@ -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) diff --git a/Mac/scripts/RunLibScript.py b/Mac/scripts/RunLibScript.py index 3a9ab7e..362cb82 100644 --- a/Mac/scripts/RunLibScript.py +++ b/Mac/scripts/RunLibScript.py @@ -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() diff --git a/Mac/scripts/fullbuild.py b/Mac/scripts/fullbuild.py index 11a6b8b..5095446 100644 --- a/Mac/scripts/fullbuild.py +++ b/Mac/scripts/fullbuild.py @@ -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 -- cgit v0.12