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.
12 if hasattr(MacOS
, 'EnableAppswitch'):
13 MacOS
.EnableAppswitch(-1)
15 from Carbon
import Qd
, QuickDraw
16 Qd
.SetCursor(Qd
.GetCursor(QuickDraw
.watchCursor
).data
)
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']
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"]
37 ide_path
= os
.path
.join(*([p
]+idepathsegs
))
38 if os
.path
.exists(ide_path
):
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
)