summaryrefslogtreecommitdiffstats
path: root/Mac/Tools
diff options
context:
space:
mode:
authorJust van Rossum <just@lettererror.com>1999-01-30 23:49:45 (GMT)
committerJust van Rossum <just@lettererror.com>1999-01-30 23:49:45 (GMT)
commita7a7193363ae5a546f67a74a97d414fc47c91e32 (patch)
tree6e5f9dbd923f4fb28cf388ef666f1658b00e9a55 /Mac/Tools
parent4f0d1f54693d6af71100927b17f56f0d6cd31c55 (diff)
downloadcpython-a7a7193363ae5a546f67a74a97d414fc47c91e32.zip
cpython-a7a7193363ae5a546f67a74a97d414fc47c91e32.tar.gz
cpython-a7a7193363ae5a546f67a74a97d414fc47c91e32.tar.bz2
There are now three possible ways to run the IDE:
- this file dropped onto the interpreter - applet built by BuildApplet (contains only __main__) - applet built by BuildIDE (contains all IDE modules)
Diffstat (limited to 'Mac/Tools')
-rw-r--r--Mac/Tools/IDE/PythonIDE.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/Mac/Tools/IDE/PythonIDE.py b/Mac/Tools/IDE/PythonIDE.py
index 50f76f9..90b7496 100644
--- a/Mac/Tools/IDE/PythonIDE.py
+++ b/Mac/Tools/IDE/PythonIDE.py
@@ -13,18 +13,25 @@ def init():
import Qd, QuickDraw
Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data)
- import Res
+ import Res, sys, os
try:
Res.GetResource('DITL', 468)
except Res.Error:
# we're not an applet
- Res.OpenResFile('Widgets.rsrc')
- Res.OpenResFile('PythonIDE.rsrc')
+ Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:PythonIDE.rsrc"))
+ Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc"))
+ sys.path.append(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE"))
else:
# we're an applet
- import sys
- if sys.argv[0] not in sys.path:
- sys.path[2:2] = [sys.argv[0]]
+ try:
+ Res.GetResource('CURS', 468)
+ except Res.Error:
+ Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc"))
+ sys.path.append(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE"))
+ else:
+ # we're a full blown applet
+ if sys.argv[0] not in sys.path:
+ sys.path[2:2] = [sys.argv[0]]
init()