Ñò §ÚêLc @ sB d Z d d k Z d d k Z d d k Z d d d d d d d d d d d d d d g Z d d d „ Z d d „ Z d „ Z d d d „ Z d d „ Z d d „ Z d d d „ Z d d „ Z d „ Z d „ Z d „ Z d d d „ Z d d „ Z d d d „ Z d d d d! „ Z d d d" „ Z d d d# „ Z d$ „ Z d S(% s@ Extract, format and print information about Python stack traces.iÿÿÿÿNt extract_stackt extract_tbt format_exceptiont format_exception_onlyt format_listt format_stackt format_tbt print_exct format_exct print_exceptiont print_lastt print_stackt print_tbt tb_linenot s c C s | i | | ƒ d S( N( t write( t filet strt terminator( ( s! /usr/lib64/python2.6/traceback.pyt _print s c C sw | d j o t i } n xV | D]N \ } } } } t | d | | | f ƒ | o t | d | i ƒ ƒ q! q! Wd S( sy Print the list of tuples as returned by extract_tb() or extract_stack() as a formatted stack trace to the given file.s File "%s", line %d, in %ss %sN( t Nonet syst stderrR t strip( t extracted_listR t filenamet linenot namet line( ( s! /usr/lib64/python2.6/traceback.pyt print_list s c C sf g } xY | D]Q \ } } } } d | | | f } | o | d | i ƒ } n | i | ƒ q W| S( s² Format a list of traceback entry tuples for printing. Given a list of tuples as returned by extract_tb() or extract_stack(), return a list of strings ready for printing. Each string in the resulting list corresponds to the item with the same index in the argument list. Each string ends in a newline; the strings may contain internal newlines as well, for those items whose source text line is not None. s File "%s", line %d, in %s s %s ( R t append( R t listR R R R t item( ( s! /usr/lib64/python2.6/traceback.pyR s c C s" | d j o t i } n | d j o! t t d ƒ o t i } qH n d } xÍ | d j o¿ | d j p | | j o¥ | i } | i } | i } | i } | i } t | d | | | f ƒ t i | ƒ t i | | | i ƒ } | o t | d | i ƒ ƒ n | i } | d } qQ Wd S( s Print up to 'limit' stack trace entries from the traceback 'tb'. If 'limit' is omitted or None, all entries are printed. If 'file' is omitted or None, the output goes to sys.stderr; otherwise 'file' should be an open file or file-like object with a write() method. t tracebacklimiti s File "%s", line %d, in %ss i N( R R R t hasattrR! t tb_frameR t f_codet co_filenamet co_nameR t linecachet checkcachet getlinet f_globalsR t tb_next( t tbt limitR t nt fR t coR R R ( ( s! /usr/lib64/python2.6/traceback.pyR . s* ' c C s t t | | ƒ ƒ S( s6 A shorthand for 'format_list(extract_stack(f, limit)).( R R ( R, R- ( ( s! /usr/lib64/python2.6/traceback.pyR J s c C s | d j o! t t d ƒ o t i } q. n g } d } xÇ | d j o¹ | d j p | | j oŸ | i } | i } | i } | i } | i } t i | ƒ t i | | | i ƒ } | o | i ƒ } n d } | i | | | | f ƒ | i } | d } q= W| S( sí Return list of up to limit pre-processed entries from traceback. This is useful for alternate formatting of stack traces. If 'limit' is omitted or None, all entries are extracted. A pre-processed stack trace entry is a quadruple (filename, line number, function name, text) representing the information that is usually printed for a stack trace. The text is a string with leading and trailing whitespace stripped; if the source is not available it is None. R! i i N( R R" R R! R# R R$ R% R&