|
5 | 5 | splash.DrawDialog() |
6 | 6 |
|
7 | 7 | from Carbon import Qd, TE, Fm |
8 | | -import sys |
9 | | - |
10 | | -_real__import__ = None |
11 | | - |
12 | | -def install_importhook(): |
13 | | - global _real__import__ |
14 | | - import __builtin__ |
15 | | - if _real__import__ is None: |
16 | | - _real__import__ = __builtin__.__import__ |
17 | | - __builtin__.__import__ = my__import__ |
18 | | - |
19 | | -def uninstall_importhook(): |
20 | | - global _real__import__ |
21 | | - if _real__import__ is not None: |
22 | | - import __builtin__ |
23 | | - __builtin__.__import__ = _real__import__ |
24 | | - _real__import__ = None |
25 | | - |
26 | | -_progress = 0 |
27 | | - |
28 | | -_about_width = 440 |
29 | | -_about_height = 340 |
30 | 8 |
|
31 | | -def importing(module): |
32 | | - global _progress |
33 | | - Qd.SetPort(splash) |
34 | | - fontID = Fm.GetFNum("Python-Sans") |
35 | | - if not fontID: |
36 | | - from Carbon.Fonts import geneva |
37 | | - fontID = geneva |
38 | | - Qd.TextFont(fontID) |
39 | | - Qd.TextSize(9) |
40 | | - labelrect = (35, _about_height - 35, _about_width - 35, _about_height - 19) |
41 | | - framerect = (35, _about_height - 19, _about_width - 35, _about_height - 11) |
42 | | - l, t, r, b = progrect = Qd.InsetRect(framerect, 1, 1) |
43 | | - if module: |
44 | | - TE.TETextBox('Importing: ' + module, labelrect, 0) |
45 | | - if not _progress: |
46 | | - Qd.FrameRect(framerect) |
47 | | - pos = min(r, l + ((r - l) * _progress) / 44) |
48 | | - Qd.PaintRect((l, t, pos, b)) |
49 | | - _progress = _progress + 1 |
50 | | - else: |
51 | | - Qd.EraseRect(labelrect) |
52 | | - Qd.PaintRect((l, t, pos, b)) |
53 | | - Qd.QDFlushPortBuffer(splash.GetDialogWindow().GetWindowPort(), None) |
54 | | - |
55 | | -def my__import__(name, globals=None, locals=None, fromlist=None): |
56 | | - try: |
57 | | - return sys.modules[name] |
58 | | - except KeyError: |
59 | | - try: |
60 | | - importing(name) |
61 | | - except: |
62 | | - try: |
63 | | - rv = _real__import__(name) |
64 | | - finally: |
65 | | - uninstall_importhook() |
66 | | - return rv |
67 | | - return _real__import__(name) |
68 | | - |
69 | | -#install_importhook() |
70 | | - |
71 | | -kHighLevelEvent = 23 |
72 | 9 | from Carbon import Win |
73 | 10 | from Carbon.Fonts import * |
74 | 11 | from Carbon.QuickDraw import * |
75 | | -from Carbon.TextEdit import * |
| 12 | +from Carbon.TextEdit import teJustCenter |
76 | 13 | import string |
77 | 14 | import sys |
78 | 15 |
|
| 16 | +_about_width = 440 |
| 17 | +_about_height = 340 |
| 18 | + |
79 | 19 | _keepsplashscreenopen = 0 |
80 | 20 |
|
81 | 21 | abouttext1 = """The Python Integrated Development Environment for the Macintosh\xaa |
|
0 commit comments