home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1860 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  1.1 KB  |  28 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __docformat__ = 'restructuredtext en'
  5. from traceback_trap import TracebackTrap
  6. from IPython.ultraTB import ColorTB
  7.  
  8. class SyncTracebackTrap(TracebackTrap):
  9.     
  10.     def __init__(self, sync_formatter = None, formatters = None, raiseException = True):
  11.         TracebackTrap.__init__(self, formatters = formatters)
  12.         if sync_formatter is None:
  13.             sync_formatter = ColorTB(color_scheme = 'LightBG')
  14.         
  15.         self.sync_formatter = sync_formatter
  16.         self.raiseException = raiseException
  17.  
  18.     
  19.     def hook(self, *args):
  20.         self.args = args
  21.         if not self.raiseException:
  22.             print self.sync_formatter(*self.args)
  23.         else:
  24.             raise 
  25.         return self.raiseException
  26.  
  27.  
  28.