home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Mac / Tools / IDE / Splash.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-06-23  |  6.1 KB  |  83 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. import Dlg
  5. import Res
  6. splash = Dlg.GetNewDialog(468, -1)
  7. splash.DrawDialog()
  8. import Qd
  9. import TE
  10. import Fm
  11. import sys
  12. _real__import__ = None
  13.  
  14. def install_importhook():
  15.     global _real__import__
  16.     import __builtin__
  17.     if _real__import__ is None:
  18.         _real__import__ = __builtin__.__import__
  19.         __builtin__.__import__ = my__import__
  20.     
  21.  
  22.  
  23. def uninstall_importhook():
  24.     global _real__import__
  25.     if _real__import__ is not None:
  26.         import __builtin__
  27.         __builtin__.__import__ = _real__import__
  28.         _real__import__ = None
  29.     
  30.  
  31. _progress = 0
  32.  
  33. def importing(module):
  34.     global _progress
  35.     Qd.SetPort(splash)
  36.     fontID = Fm.GetFNum('Python-Sans')
  37.     if not fontID:
  38.         fontID = geneva
  39.     
  40.     Qd.TextFont(fontID)
  41.     Qd.TextSize(9)
  42.     rect = (35, 260, 365, 276)
  43.     if module:
  44.         TE.TETextBox('Importing: ' + module, rect, 0)
  45.         if not _progress:
  46.             Qd.FrameRect((35, 276, 365, 284))
  47.         
  48.         pos = min(36 + 330 * _progress / 44, 364)
  49.         Qd.PaintRect((36, 277, pos, 283))
  50.         _progress = _progress + 1
  51.     else:
  52.         Qd.EraseRect(rect)
  53.         Qd.PaintRect((36, 277, pos, 283))
  54.  
  55.  
  56. def my__import__(name, globals = None, locals = None, fromlist = None):
  57.     
  58.     try:
  59.         return sys.modules[name]
  60.     except KeyError:
  61.         
  62.         try:
  63.             importing(name)
  64.         except:
  65.             
  66.             try:
  67.                 rv = _real__import__(name)
  68.             finally:
  69.                 uninstall_importhook()
  70.  
  71.             return rv
  72.  
  73.         return _real__import__(name)
  74.  
  75.  
  76. install_importhook()
  77. kHighLevelEvent = 23
  78. import Win
  79. *
  80. *
  81. *
  82. UpdateSplash(1)
  83.