‡Æ
ïÞ?:c       sý   d  Z  d k Z d k Z d k Z d k Z d d d „ Z e d „ Z d „  Z e e d „ Z	 e d „ Z
 e d	 „ Z e e d
 „ Z e d „ Z d „  Z d „  Z e e d „ Z e e d „ Z e e e d „ Z e e d „ Z e e d „ Z d „  Z d S(   s@   Extract, format and print information about Python stack traces.Nc    s   |  i | | ƒ d  S(   N(   s   files   writes   strs
   terminator(   s   files   strs
   terminators8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   _print s    s    s   
c    sw   | o t i } n x[ |  d rQ \ } } } } t | d | | | f ƒ | o t | d t	 i
 | ƒ ƒ n q Wd S(   sv   Print the list of tuples as returned by extract_tb() or
	extract_stack() as a formatted stack trace to the given file.i    s     File "%s", line %d, in %ss       %sN(   s   files   syss   stderrs   extracted_lists   filenames   linenos   names   lines   _prints   strings   strip(   s   extracted_lists   files   filenames   linenos   names   lines8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys
   print_list s     	 c    so   g  } x^ |  d rT \ } } } } d | | | f } | o | d t i | ƒ } n | i	 | ƒ q W| Sd S(   sc  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.i    s     File "%s", line %d, in %s
s       %s
N(
   s   lists   extracted_lists   filenames   linenos   names   lines   items   strings   strips   append(   s   extracted_lists   lists   filenames   linenos   names   lines   items8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   format_list s     	 c 
   s  | o t i } n | t j o! t t d ƒ o t i } n n d } xÀ |  t j	 o | t j p
 | | j  o˜ |  i	 } t |  ƒ } | i } | i } | i } t | d | | | f ƒ t i | | ƒ }	 |	 o t | d t i |	 ƒ ƒ n |  i }  | d } qL 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.s   tracebacklimiti    s     File "%s", line %d, in %ss       i   N(   s   files   syss   stderrs   limits   Nones   hasattrs   tracebacklimits   ns   tbs   tb_frames   fs	   tb_linenos   linenos   f_codes   cos   co_filenames   filenames   co_names   names   _prints	   linecaches   getlines   lines   strings   strips   tb_next(
   s   tbs   limits   files   ns   fs   linenos   cos   filenames   names   lines8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   print_tb' s*      '				 	c    s   t  t |  | ƒ ƒ Sd S(   s6   A shorthand for 'format_list(extract_stack(f, limit)).N(   s   format_lists
   extract_tbs   tbs   limit(   s   tbs   limits8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys	   format_tb? s     c 
   sÿ   | t j o! t t d ƒ o t i } n n g  } d } xº |  t j	 o | t j p
 | | j  o’ |  i } t
 |  ƒ } | i } | i } | i } t i | | ƒ }	 |	 o t i |	 ƒ }	 n t }	 | i | | | |	 f ƒ |  i }  | d } q= W| Sd S(   s  Return a list of up to 'limit' pre-processed stack trace entries
	extracted from the traceback object '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.s   tracebacklimiti    i   N(   s   limits   Nones   hasattrs   syss   tracebacklimits   lists   ns   tbs   tb_frames   fs	   tb_linenos   linenos   f_codes   cos   co_filenames   filenames   co_names   names	   linecaches   getlines   lines   strings   strips   appends   tb_next(
   s   tbs   limits   lists   ns   fs   linenos   cos   filenames   names   lines8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys
   extract_tbC s*      '				 	c    s   | o t i } n | o! t | d ƒ t | | | ƒ n t |  | ƒ } x% | d  d r } t | | d ƒ qZ Wt | | d d ƒ d S(   sý  Print exception information and up to 'limit' stack trace entries
	from the traceback 'tb' to 'file'.  This differs from print_tb() in
	the following ways: (1) if traceback is not None, it prints a header
	"Traceback (most recent call last):"; (2) it prints the exception type and
	value after the stack trace; (3) if type is SyntaxError and value has
	the appropriate format, it prints the line where the syntax error
	occurred with a caret on the next line indicating the approximate
	position of the error.s"   Traceback (most recent call last):i   i    s    s    N(   s   files   syss   stderrs   tbs   _prints   print_tbs   limits   format_exception_onlys   etypes   values   liness   line(   s   etypes   values   tbs   limits   files   liness   lines8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   print_exception` s      c    sH   | o  d g } | t | | ƒ } n g  } | t |  | ƒ } | Sd S(   sg  Format a stack trace and the exception information.  The arguments
	have the same meaning as the corresponding arguments to
	print_exception().  The return value is a list of strings, each
	ending in a newline and some containing internal newlines.  When 
	these lines are concatenated and printed, exactly the same text is
	printed as does print_exception().s#   Traceback (most recent call last):
N(   s   tbs   lists	   format_tbs   limits   format_exception_onlys   etypes   value(   s   etypes   values   tbs   limits   lists8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   format_exceptions s     	c    sž  g  } t |  ƒ t i j o |  i } n |  } | t j o | i	 t
 | ƒ d ƒ n@|  t j oy | \ } \ } } } } Wn næ X| o
 d } n | i	 d | | f ƒ d }	 x6 |	 t | ƒ j  o | |	 t i j o |	 d }	 q¼ W| i	 d t i | ƒ ƒ d }
 xC | |	 | d !d r. } | t i j o |
 | }
 n |
 d }
 q&W| i	 d	 |
 ƒ | } n | i	 d
 t
 | ƒ t | ƒ f ƒ | Sd S(   sñ  Format the exception part of a traceback.  The arguments are the
	exception type and value such as given by sys.last_type and
	sys.last_value. The return value is a list of strings, each ending
	in a newline.  Normally, the list contains a single string;
	however, for SyntaxError exceptions, it contains several lines that
	(when printed) display detailed information about where the syntax
	error occurred.  The message indicating which exception occurred is
	the always last string in the list.s   
s   <string>s     File "%s", line %d
i    i   s       %s
s       s    s   %s^
s   %s: %s
N(   s   lists   types   etypes   typess	   ClassTypes   __name__s   stypes   values   Nones   appends   strs   SyntaxErrors   msgs   filenames   linenos   offsets   lines   is   lens   strings
   whitespaces   strips   ss   cs	   _some_str(   s   etypes   values   lists   stypes   msgs   filenames   linenos   offsets   lines   is   ss   cs8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   format_exception_only‚ s<      
 ' 
#c    s-   y t  |  ƒ SWn d t |  ƒ i Sn Xd  S(   Ns   <unprintable %s object>(   s   strs   values   types   __name__(   s   values8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys	   _some_str¬ s    c    sZ   | o t i } n z/ t i ƒ  \ } } } t | | | |  | ƒ Wd t	 } } } Xd S(   sÃ   This is a shorthand for 'print_exception(sys.exc_type,
	sys.exc_value, sys.exc_traceback, limit, file)'.
	(In fact, it uses sys.exc_info() to retrieve the same information
	in a thread-safe way.)N(
   s   files   syss   stderrs   exc_infos   etypes   values   tbs   print_exceptions   limits   None(   s   limits   files   etypes   values   tbs8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys	   print_exc³ s      c    s8   | o t i } n t t i t i t i |  | ƒ d S(   sk   This is a shorthand for 'print_exception(sys.last_type,
	sys.last_value, sys.last_traceback, limit, file)'.N(   s   files   syss   stderrs   print_exceptions	   last_types
   last_values   last_tracebacks   limit(   s   limits   files8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys
   print_lastÀ s
     c    sa   |  t j o: y
 t ‚ Wn) t j
 o t i ƒ  d i i }  n Xn t t |  | ƒ | ƒ d S(   s÷   This function prints a stack trace from its invocation point.
	The optional 'f' argument can be used to specify an alternate stack
	frame at which to start. The optional 'limit' and 'file' arguments
	have the same meaning as for print_exception().i   N(   s   fs   Nones   ZeroDivisionErrors   syss   exc_infos   tb_frames   f_backs
   print_lists   extract_stacks   limits   file(   s   fs   limits   files8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   print_stackÉ s     
c    s^   |  t j o: y
 t ‚ Wn) t j
 o t i ƒ  d i i }  n Xn t t |  | ƒ ƒ Sd S(   s7   A shorthand for 'format_list(extract_stack(f, limit))'.i   N(
   s   fs   Nones   ZeroDivisionErrors   syss   exc_infos   tb_frames   f_backs   format_lists   extract_stacks   limit(   s   fs   limits8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   format_stackÕ s     
c 	   sD  |  t j o: y
 t ‚ Wn) t j
 o t i ƒ  d i i }  n Xn | t j o! t t d ƒ o t i	 } n n g  } d } x® |  t j	 o | t j p
 | | j  o† |  i } |  i } | i } | i } t i | | ƒ } | o t i | ƒ } n t } | i | | | | f ƒ |  i }  | d } q„ W| i ƒ  | Sd S(   s_  Extract the raw traceback from the current stack frame.  The
	return value has the same format as for extract_tb().  The optional
	'f' and 'limit' arguments have the same meaning as for print_stack(). 
	Each item in the list is a quadruple (filename, line number,
	function name, text), and the entries are in order from oldest
	to newest stack frame.i   s   tracebacklimiti    i   N(   s   fs   Nones   ZeroDivisionErrors   syss   exc_infos   tb_frames   f_backs   limits   hasattrs   tracebacklimits   lists   ns   f_linenos   linenos   f_codes   cos   co_filenames   filenames   co_names   names	   linecaches   getlines   lines   strings   strips   appends   reverse(	   s   fs   limits   lists   ns   linenos   cos   filenames   names   lines8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   extract_stackÞ s4     
 '				 	
c    s´   |  i i } t | d ƒ o |  i Sn | i } | i } |  i
 } d } x` t d t | ƒ d ƒ d rD } | t | | ƒ } | | j o Pn | t | | d ƒ } qd W| Sd S(   sR   Calculate the correct line number of the traceback given in tb
	(even with -O on).s	   co_lnotabi    i   i   N(   s   tbs   tb_frames   f_codes   cs   hasattrs	   tb_linenos	   co_lnotabs   tabs   co_firstlinenos   lines   tb_lastis   stopats   addrs   ranges   lens   is   ord(   s   tbs   cs   tabs   lines   stopats   addrs   is8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys	   tb_linenoý s     			 (   s   __doc__s	   linecaches   strings   syss   typess   _prints   Nones
   print_lists   format_lists   print_tbs	   format_tbs
   extract_tbs   print_exceptions   format_exceptions   format_exception_onlys	   _some_strs	   print_excs
   print_lasts   print_stacks   format_stacks   extract_stacks	   tb_lineno(    s8   /home/guest/edwardam/cmp2/py2/lib/python2.0/traceback.pys   ? s(   						*			