Mercurial > cpython-lru_cache-weakref
annotate Mac/Tools/IDE/PythonIDE.py @ 19488:42b2f1936254 legacy-trunk
Import the MacOS toolbox modules from the Carbon package.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Sat, 25 Aug 2001 12:15:04 +0000 |
| parents | c5ac6f055c62 |
| children | 546ef318ba5d |
| rev | line source |
|---|---|
|
18167
c5ac6f055c62
Some long overdue maintainance. Made all IDE sources 7-bit-clean, to avoid any further encoding conversion troubles.
Just van Rossum <just@letterror.com>
parents:
11424
diff
changeset
|
1 # copyright 1996-2001 Just van Rossum, Letterror. just@letterror.com |
| 10047 | 2 |
| 3 # keep this (__main__) as clean as possible, since we are using | |
| 4 # it like the "normal" interpreter. | |
| 5 | |
|
18167
c5ac6f055c62
Some long overdue maintainance. Made all IDE sources 7-bit-clean, to avoid any further encoding conversion troubles.
Just van Rossum <just@letterror.com>
parents:
11424
diff
changeset
|
6 __version__ = '1.0.1' |
| 10047 | 7 |
| 8 | |
| 9 def init(): | |
| 10 import MacOS | |
| 11 MacOS.EnableAppswitch(-1) | |
| 12 | |
|
19488
42b2f1936254
Import the MacOS toolbox modules from the Carbon package.
Jack Jansen <jack.jansen@cwi.nl>
parents:
18167
diff
changeset
|
13 from Carbon import Qd, QuickDraw |
| 10047 | 14 Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) |
| 15 | |
|
19488
42b2f1936254
Import the MacOS toolbox modules from the Carbon package.
Jack Jansen <jack.jansen@cwi.nl>
parents:
18167
diff
changeset
|
16 from Carbon import Res |
|
42b2f1936254
Import the MacOS toolbox modules from the Carbon package.
Jack Jansen <jack.jansen@cwi.nl>
parents:
18167
diff
changeset
|
17 import sys, os |
| 10047 | 18 try: |
| 19 Res.GetResource('DITL', 468) | |
| 20 except Res.Error: | |
| 21 # we're not an applet | |
|
10314
90c752ae44a6
open res file(s) read only; upped __version__ -- jvr
Just van Rossum <just@lettererror.com>
parents:
10050
diff
changeset
|
22 Res.FSpOpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:PythonIDE.rsrc"), 1) |
|
90c752ae44a6
open res file(s) read only; upped __version__ -- jvr
Just van Rossum <just@lettererror.com>
parents:
10050
diff
changeset
|
23 Res.FSpOpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc"), 1) |
|
10050
66858fdf467e
Add $(APPLICATION) or :Mac:Tools:IDE at the very start of sys.path to improve startup time -- jvr
Just van Rossum <just@lettererror.com>
parents:
10049
diff
changeset
|
24 ide_path = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE") |
| 10047 | 25 else: |
| 26 # 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
|
27 try: |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
28 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
|
29 except Res.Error: |
|
10314
90c752ae44a6
open res file(s) read only; upped __version__ -- jvr
Just van Rossum <just@lettererror.com>
parents:
10050
diff
changeset
|
30 Res.FSpOpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc"), 1) |
|
10050
66858fdf467e
Add $(APPLICATION) or :Mac:Tools:IDE at the very start of sys.path to improve startup time -- jvr
Just van Rossum <just@lettererror.com>
parents:
10049
diff
changeset
|
31 ide_path = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE") |
|
10049
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
32 else: |
|
dce104e1a73b
There are now three possible ways to run the IDE:
Just van Rossum <just@lettererror.com>
parents:
10047
diff
changeset
|
33 # we're a full blown applet |
|
10050
66858fdf467e
Add $(APPLICATION) or :Mac:Tools:IDE at the very start of sys.path to improve startup time -- jvr
Just van Rossum <just@lettererror.com>
parents:
10049
diff
changeset
|
34 ide_path = sys.argv[0] |
|
66858fdf467e
Add $(APPLICATION) or :Mac:Tools:IDE at the very start of sys.path to improve startup time -- jvr
Just van Rossum <just@lettererror.com>
parents:
10049
diff
changeset
|
35 if ide_path not in sys.path: |
|
66858fdf467e
Add $(APPLICATION) or :Mac:Tools:IDE at the very start of sys.path to improve startup time -- jvr
Just van Rossum <just@lettererror.com>
parents:
10049
diff
changeset
|
36 sys.path.insert(0, ide_path) |
| 10047 | 37 |
| 38 | |
| 39 init() | |
| 40 del init | |
| 41 | |
| 42 import PythonIDEMain |
