Mercurial > cpython-lru_cache-weakref
annotate Mac/Tools/IDE/PythonIDE.py @ 10049:dce104e1a73b legacy-trunk
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)
| author | Just van Rossum <just@lettererror.com> |
|---|---|
| date | Sat, 30 Jan 1999 23:49:45 +0000 |
| parents | a0b06891d286 |
| children | 66858fdf467e |
| rev | line source |
|---|---|
| 10047 | 1 # copyright 1996-1999 Just van Rossum, Letterror. just@letterror.com |
| 2 | |
| 3 # keep this (__main__) as clean as possible, since we are using | |
| 4 # it like the "normal" interpreter. | |
| 5 | |
| 6 __version__ = '1.0b2' | |
| 7 | |
| 8 | |
| 9 def init(): | |
| 10 import MacOS | |
| 11 MacOS.EnableAppswitch(-1) | |
| 12 | |
| 13 import Qd, QuickDraw | |
| 14 Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) | |
| 15 | |
|
10049
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
16 import Res, sys, os |
| 10047 | 17 try: |
| 18 Res.GetResource('DITL', 468) | |
| 19 except Res.Error: | |
| 20 # we're not an applet | |
|
10049
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
21 Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:PythonIDE.rsrc")) |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
22 Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc")) |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
23 sys.path.append(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE")) |
| 10047 | 24 else: |
| 25 # we're an applet | |
|
10049
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
26 try: |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
27 Res.GetResource('CURS', 468) |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
28 except Res.Error: |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
29 Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc")) |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
30 sys.path.append(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE")) |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
31 else: |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
32 # we're a full blown applet |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
33 if sys.argv[0] not in sys.path: |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
34 sys.path[2:2] = [sys.argv[0]] |
| 10047 | 35 |
| 36 | |
| 37 init() | |
| 38 del init | |
| 39 | |
| 40 import PythonIDEMain |
