blob: a2041e0e55c25b73510f762fe32249175392d21a [file] [log] [blame]
Just van Rossumdc3c6172001-06-19 21:37:33 +00001# copyright 1996-2001 Just van Rossum, Letterror. just@letterror.com
Just van Rossum40f9b7b1999-01-30 22:39:17 +00002
3# keep this (__main__) as clean as possible, since we are using
4# it like the "normal" interpreter.
5
Just van Rossumdc3c6172001-06-19 21:37:33 +00006__version__ = '1.0.1'
Jack Jansen815d2bf2002-01-21 23:00:52 +00007import sys
8import os
Just van Rossum40f9b7b1999-01-30 22:39:17 +00009
10def init():
11 import MacOS
Jack Jansen815d2bf2002-01-21 23:00:52 +000012 if hasattr(MacOS, 'EnableAppswitch'):
13 MacOS.EnableAppswitch(-1)
Just van Rossum40f9b7b1999-01-30 22:39:17 +000014
Jack Jansen5a6fdcd2001-08-25 12:15:04 +000015 from Carbon import Qd, QuickDraw
Just van Rossum40f9b7b1999-01-30 22:39:17 +000016 Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data)
17
Jack Jansen3c06b9a2001-08-27 21:41:23 +000018 import macresource
Jack Jansen5a6fdcd2001-08-25 12:15:04 +000019 import sys, os
Jack Jansen3c06b9a2001-08-27 21:41:23 +000020 macresource.need('DITL', 468, "PythonIDE.rsrc")
Jack Jansen815d2bf2002-01-21 23:00:52 +000021 widgetrespathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE", "Widgets.rsrc"]
22 widgetresfile = os.path.join(*widgetrespathsegs)
Jack Jansen3c06b9a2001-08-27 21:41:23 +000023 refno = macresource.need('CURS', 468, widgetresfile)
24 if refno:
25 # We're not a fullblown application
Jack Jansen815d2bf2002-01-21 23:00:52 +000026 idepathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE"]
27 ide_path = os.path.join(*idepathsegs)
Just van Rossum40f9b7b1999-01-30 22:39:17 +000028 else:
Jack Jansen3c06b9a2001-08-27 21:41:23 +000029 # We are a fully frozen application
30 ide_path = sys.argv[0]
Just van Rossum99ec5a51999-01-31 23:17:56 +000031 if ide_path not in sys.path:
32 sys.path.insert(0, ide_path)
Just van Rossum40f9b7b1999-01-30 22:39:17 +000033
34
35init()
36del init
37
38import PythonIDEMain