Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d564fd

Browse files
committed
removed import display hackery
1 parent f7f9388 commit 2d564fd

2 files changed

Lines changed: 5 additions & 66 deletions

File tree

Mac/Tools/IDE/PythonIDEMain.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# copyright 1997-2000 Just van Rossum, Letterror. [email protected]
1+
# copyright 1997-2001 Just van Rossum, Letterror. [email protected]
22

33
import Splash
44

@@ -29,7 +29,6 @@ def __init__(self):
2929
self.quitevent)
3030
import PyConsole, PyEdit
3131
Splash.wait()
32-
Splash.uninstall_importhook()
3332
PyConsole.installoutput()
3433
PyConsole.installconsole()
3534
import sys

Mac/Tools/IDE/Splash.py

Lines changed: 4 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,17 @@
55
splash.DrawDialog()
66

77
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
308

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
729
from Carbon import Win
7310
from Carbon.Fonts import *
7411
from Carbon.QuickDraw import *
75-
from Carbon.TextEdit import *
12+
from Carbon.TextEdit import teJustCenter
7613
import string
7714
import sys
7815

16+
_about_width = 440
17+
_about_height = 340
18+
7919
_keepsplashscreenopen = 0
8020

8121
abouttext1 = """The Python Integrated Development Environment for the Macintosh\xaa

0 commit comments

Comments
 (0)