summaryrefslogtreecommitdiffstats
path: root/Mac/scripts
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-08-27 21:41:23 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-08-27 21:41:23 (GMT)
commit3c06b9a7d4fa144eebd4786f71c4a301726e0c3c (patch)
tree4f9cdc3420a0b7d6cd76ec44245df09628e98993 /Mac/scripts
parenta5d7da528bda145426c50ad9ded8d0707d5f302c (diff)
downloadcpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.zip
cpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.tar.gz
cpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.tar.bz2
Use the new macresource module to open the accompanying resource file (if needed).
Diffstat (limited to 'Mac/scripts')
-rw-r--r--Mac/scripts/BuildApplication.py9
-rw-r--r--Mac/scripts/EditPythonPrefs.py6
-rw-r--r--Mac/scripts/MkDistr_ui.py5
-rw-r--r--Mac/scripts/fullbuild.py7
4 files changed, 9 insertions, 18 deletions
diff --git a/Mac/scripts/BuildApplication.py b/Mac/scripts/BuildApplication.py
index ee82b7a..a7c8f40 100644
--- a/Mac/scripts/BuildApplication.py
+++ b/Mac/scripts/BuildApplication.py
@@ -18,6 +18,7 @@ from Carbon import Res
from Carbon import Dlg
import EasyDialogs
import buildtools
+import macresource
# Hmmm...
MACFREEZEPATH = os.path.join(sys.prefix, ":Mac:Tools:macfreeze")
@@ -38,13 +39,7 @@ GEN68K_BUTTON = 6
PPC_ONLY=1
-try:
- Res.GetResource('DITL', DLG_ID)
-except Res.Error:
- Res.FSpOpenResFile("BuildApplication.rsrc", 1)
-else:
- pass # we're an applet
-
+macresource.need('DITL', DLG_ID, "BuildApplication.rsrc")
def main():
try:
diff --git a/Mac/scripts/EditPythonPrefs.py b/Mac/scripts/EditPythonPrefs.py
index 00119e0..833e607 100644
--- a/Mac/scripts/EditPythonPrefs.py
+++ b/Mac/scripts/EditPythonPrefs.py
@@ -15,6 +15,7 @@ import os
import sys
from Carbon import Res # For Res.Error
import pythonprefs
+import macresource
import EasyDialogs
try:
from Carbon import Help
@@ -195,10 +196,7 @@ def edit_applet(name):
handler.save(result)
def main():
- try:
- h = FSpOpenResFile('EditPythonPrefs.rsrc', 1)
- except Res.Error:
- pass # Assume we already have acces to our own resource
+ macresource.need('DLOG', DIALOG_ID, 'EditPythonPrefs.rsrc')
MacOS.SchedParams(1, 0)
if len(sys.argv) <= 1:
diff --git a/Mac/scripts/MkDistr_ui.py b/Mac/scripts/MkDistr_ui.py
index 3ea78a9..5386950 100644
--- a/Mac/scripts/MkDistr_ui.py
+++ b/Mac/scripts/MkDistr_ui.py
@@ -23,6 +23,7 @@ import EasyDialogs
import macfs
import os
import sys
+import macresource
# Resource IDs
ID_MAIN = 514
@@ -321,7 +322,7 @@ def GetType():
def InitUI():
"""Initialize stuff needed by UI (a resource file)"""
- Res.FSpOpenResFile('MkDistr.rsrc', 1)
+ macresource.need('DLOG', ID_MAIN, 'MkDistr.rsrc', modname=__name__)
class _testerhelp:
def __init__(self, which):
@@ -340,7 +341,7 @@ class _testerhelp:
class _test:
def __init__(self):
import sys
- Res.FSpOpenResFile('MkDistr.rsrc', 1)
+ InitUI()
self.inc = _testerhelp('include')
self.exc = _testerhelp('exclude')
self.ui = MkDistrUI(self)
diff --git a/Mac/scripts/fullbuild.py b/Mac/scripts/fullbuild.py
index f5ccfc9..8954739 100644
--- a/Mac/scripts/fullbuild.py
+++ b/Mac/scripts/fullbuild.py
@@ -19,6 +19,7 @@ import EasyDialogs
import re
import string
import genpluginprojects
+import macresource
import aetools
from Carbon import AppleEvents
@@ -369,11 +370,7 @@ def incbuildno(filename):
fp.close()
def main():
- try:
- h = Res.FSpOpenResFile('fullbuild.rsrc', 1)
- except Res.Error:
- pass # Assume we already have acces to our own resource
-
+ macresource.need('DLOG', DIALOG_ID, 'fullbuild.rsrc')
dir, ok = macfs.GetDirectory('Python source folder:')
if not ok:
sys.exit(0)