Commit a7a71933 authored by Just van Rossum's avatar Just van Rossum

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)
parent 4f0d1f54
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment