home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_1934 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  1.4 KB  |  29 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __docformat__ = 'restructuredtext en'
  5. import traceback
  6.  
  7. class ITracebackFormatter(object):
  8.     kind = 'traceback'
  9.     identifier = None
  10.     
  11.     def __call__(self, exc_type, exc_value, exc_traceback):
  12.         raise NotImplementedError
  13.  
  14.  
  15.  
  16. class PlainTracebackFormatter(ITracebackFormatter):
  17.     identifier = 'plain'
  18.     
  19.     def __init__(self, limit = None):
  20.         self.limit = limit
  21.  
  22.     
  23.     def __call__(self, exc_type, exc_value, exc_traceback):
  24.         lines = traceback.format_tb(exc_traceback, self.limit)
  25.         lines.append('%s: %s' % (exc_type.__name__, exc_value))
  26.         return '\n'.join(lines)
  27.  
  28.  
  29.