Mercurial > cpython-lru_cache-weakref
annotate Mac/Tools/IDE/PythonIDE.py @ 19515:546ef318ba5d legacy-trunk
Use the new macresource module to open the accompanying resource file (if needed).
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Mon, 27 Aug 2001 21:41:23 +0000 |
| parents | 42b2f1936254 |
| children | ec750e37671b |
| 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 | |
|
19515
546ef318ba5d
Use the new macresource module to open the accompanying resource file (if needed).
Jack Jansen <jack.jansen@cwi.nl>
parents:
19488
diff
changeset
|
16 import macresource |
|
19488
42b2f1936254
Import the MacOS toolbox modules from the Carbon package.
Jack Jansen <jack.jansen@cwi.nl>
parents:
18167
diff
changeset
|
17 import sys, os |
|
19515
546ef318ba5d
Use the new macresource module to open the accompanying resource file (if needed).
Jack Jansen <jack.jansen@cwi.nl>
parents:
19488
diff
changeset
|
18 macresource.need('DITL', 468, "PythonIDE.rsrc") |
|
546ef318ba5d
Use the new macresource module to open the accompanying resource file (if needed).
Jack Jansen <jack.jansen@cwi.nl>
parents:
19488
diff
changeset
|
19 widgetresfile = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc") |
|
546ef318ba5d
Use the new macresource module to open the accompanying resource file (if needed).
Jack Jansen <jack.jansen@cwi.nl>
parents:
19488
diff
changeset
|
20 refno = macresource.need('CURS', 468, widgetresfile) |
|
546ef318ba5d
Use the new macresource module to open the accompanying resource file (if needed).
Jack Jansen <jack.jansen@cwi.nl>
parents:
19488
diff
changeset
|
21 if refno: |
|
546ef318ba5d
Use the new macresource module to open the accompanying resource file (if needed).
Jack Jansen <jack.jansen@cwi.nl>
parents:
19488
diff
changeset
|
22 # We're not a fullblown application |
|
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
|
23 ide_path = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE") |
| 10047 | 24 else: |
|
19515
546ef318ba5d
Use the new macresource module to open the accompanying resource file (if needed).
Jack Jansen <jack.jansen@cwi.nl>
parents:
19488
diff
changeset
|
25 # We are a fully frozen application |
|
546ef318ba5d
Use the new macresource module to open the accompanying resource file (if needed).
Jack Jansen <jack.jansen@cwi.nl>
parents:
19488
diff
changeset
|
26 ide_path = sys.argv[0] |
|
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
|
27 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
|
28 sys.path.insert(0, ide_path) |
| 10047 | 29 |
| 30 | |
| 31 init() | |
| 32 del init | |
| 33 | |
| 34 import PythonIDEMain |
