More installation info. Bump alpha version.
[python/dscho.git] / Mac / Tools / IDE / PythonIDE.py
blob3a1a66a57acce58a8045d29ec0da485a0c2b57f4
1 # copyright 1996-2001 Just van Rossum, Letterror. just@letterror.com
3 # keep this (__main__) as clean as possible, since we are using
4 # it like the "normal" interpreter.
6 __version__ = '1.0.1'
7 import sys
8 import os
10 def init():
11 import MacOS
12 if hasattr(MacOS, 'EnableAppswitch'):
13 MacOS.EnableAppswitch(-1)
15 from Carbon import Qd, QuickDraw
16 Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data)
18 import macresource
19 import sys, os
20 macresource.need('DITL', 468, "PythonIDE.rsrc")
21 widgetrespathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE", "Widgets.rsrc"]
22 widgetresfile = os.path.join(*widgetrespathsegs)
23 if not os.path.exists(widgetresfile):
24 widgetrespathsegs = [os.pardir, "Tools", "IDE", "Widgets.rsrc"]
25 widgetresfile = os.path.join(*widgetrespathsegs)
26 refno = macresource.need('CURS', 468, widgetresfile)
27 if os.environ.has_key('PYTHONIDEPATH'):
28 # For development set this environment variable
29 ide_path = os.environ['PYTHONIDEPATH']
30 elif refno:
31 # We're not a fullblown application
32 idepathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE"]
33 ide_path = os.path.join(*idepathsegs)
34 if not os.path.exists(ide_path):
35 idepathsegs = [os.pardir, "Tools", "IDE"]
36 for p in sys.path:
37 ide_path = os.path.join(*([p]+idepathsegs))
38 if os.path.exists(ide_path):
39 break
41 else:
42 # We are a fully frozen application
43 ide_path = sys.argv[0]
44 if ide_path not in sys.path:
45 sys.path.insert(0, ide_path)
48 init()
49 del init
51 import PythonIDEMain