-í
ç¶<c       s  d  Z  d k l Z l Z l Z l Z d k Z y d k l Z Wn  e	 j
 o d k l Z n Xd d d d d d	 g Z
 d
 i Z e i Z e Z e Z e Z e d „ Z d „  Z d „  Z d „  Z d „  Z d	 f  d „  ƒ  YZ d „  Z d „  Z e d „ Z e d j o e ƒ  n d S(   s/  Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.sydout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

(   s   DictTypes   ListTypes	   TupleTypes
   StringTypeN(   s   StringIOs   pprints   pformats
   isreadables   isrecursives   safereprs   PrettyPrinters   , c    s    t  d | ƒ } | i |  ƒ d S(   sA   Pretty-print a Python object to a stream [default is sys.sydout].s   streamN(   s   PrettyPrinters   streams   printers   pprints   object(   s   objects   streams   printer(    (    s   /usr/lib/python2.2/pprint.pys   pprint8 s     c    s   t  ƒ  i |  ƒ Sd S(   s<   Format a Python object into a pretty-printed representation.N(   s   PrettyPrinters   pformats   object(   s   object(    (    s   /usr/lib/python2.2/pprint.pys   pformat= s     c    s   t  |  h  t d ƒ d Sd S(   s=   Version of repr() which can handle recursive data structures.i    N(   s
   _safe_reprs   objects   None(   s   object(    (    s   /usr/lib/python2.2/pprint.pys   safereprA s     c    s   t  |  h  t d ƒ d Sd S(   s4   Determine if saferepr(object) is readable by eval().i    i   N(   s
   _safe_reprs   objects   None(   s   object(    (    s   /usr/lib/python2.2/pprint.pys
   isreadableE s     c    s   t  |  h  t d ƒ d Sd S(   s8   Determine if object requires a recursive representation.i    i   N(   s
   _safe_reprs   objects   None(   s   object(    (    s   /usr/lib/python2.2/pprint.pys   isrecursiveI s     c      sS   t  Z d d e e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d	 „  Z	 RS(
   Ni   iP   c    sW   t  | ƒ } t  | ƒ } | |  _ | |  _ | |  _ | o | |  _	 n t
 i |  _	 d S(   sò  Handle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        N(   s   ints   indents   widths   depths   selfs   _PrettyPrinter__depths    _PrettyPrinter__indent_per_levels   _PrettyPrinter__widths   streams   _PrettyPrinter__streams   syss   stdout(   s   selfs   indents   widths   depths   stream(    (    s   /usr/lib/python2.2/pprint.pys   __init__N s        			c    s!   |  i i |  i | ƒ d ƒ d  S(   Ns   
(   s   selfs   _PrettyPrinter__streams   writes   pformats   object(   s   selfs   object(    (    s   /usr/lib/python2.2/pprint.pys   pprintm s    c    s3   t  ƒ  } |  i | | d d h  d ƒ | i ƒ  Sd  S(   Ni    (   s   StringIOs   sios   selfs   _PrettyPrinter__formats   objects   getvalue(   s   selfs   objects   sio(    (    s   /usr/lib/python2.2/pprint.pys   pformatp s    	c    s'   d |  _ |  i | h  d ƒ |  i Sd  S(   Ni    (   s   selfs   _PrettyPrinter__recursives   _PrettyPrinter__reprs   object(   s   selfs   object(    (    s   /usr/lib/python2.2/pprint.pys   isrecursiveu s    	c    s;   d |  _ d |  _ |  i | h  d ƒ |  i o |  i Sd  S(   Ni    i   (   s   selfs   _PrettyPrinter__recursives   _PrettyPrinter__readables   _PrettyPrinter__reprs   object(   s   selfs   object(    (    s   /usr/lib/python2.2/pprint.pys
   isreadablez s    		c    s¼  | d } t | ƒ } | | j o- | i t | ƒ ƒ d |  _	 d |  _
 d  Sn |  i | | | d ƒ } t | ƒ } t | ƒ |  i d | | j } | i } | o| t j o‹| d ƒ |  i d j o | |  i d d ƒ n t | ƒ } | o3d | | <| |  i } | i ƒ  }
 |
 i ƒ  |
 d \ } } |  i | | | ƒ } | | ƒ | d ƒ |  i | | | t | ƒ d | d | | ƒ | d j oz xs |
 d D]g \ } } |  i | | | ƒ } | d d | | f ƒ |  i | | | t | ƒ d | d | | ƒ q¥Wn | |  i } | | =n | d ƒ d  Sn | t j p
 | t j oR| t j o | d	 ƒ d
 }	 n | d ƒ d }	 |  i d j o | |  i d d ƒ n t | ƒ } | o« d | | <| |  i } |  i | d | | | d | | ƒ | d j oK xD | d D]8 } | d d | ƒ |  i | | | | d | | ƒ qWn | |  i } | | =n | t j o
 | d j o | d ƒ n | |	 ƒ d  Sn n | | ƒ d  S(   Ni   i    s   {s    s   : i   s   ,
%s%s: s   }s   [s   ]s   (s   )s   ,
s   ,(   s   levels   _ids   objects   objids   contexts   streams   writes
   _recursions   selfs   _PrettyPrinter__recursives   _PrettyPrinter__readables   _PrettyPrinter__reprs   reps   _types   typs   _lens   _PrettyPrinter__widths   indents	   allowances   sepLiness   DictTypes    _PrettyPrinter__indent_per_levels   lengths   itemss   sorts   keys   ents   _PrettyPrinter__formats   ListTypes	   TupleTypes   endchar(   s   selfs   objects   streams   indents	   allowances   contexts   levels   keys   typs   endchars   itemss   writes   lengths   ents   objids   reps   sepLines(    (    s   /usr/lib/python2.2/pprint.pys   __format€ s„    
		!	




 





 
c    sR   t  | | |  i | ƒ \ } } } | o d |  _	 n | o d |  _
 n | Sd  S(   Ni    i   (   s
   _safe_reprs   objects   contexts   selfs   _PrettyPrinter__depths   levels   reprs   readables	   recursives   _PrettyPrinter__readables   _PrettyPrinter__recursive(   s   selfs   objects   contexts   levels	   recursives   readables   repr(    (    s   /usr/lib/python2.2/pprint.pys   __reprÆ s    	(
   s   __name__s
   __module__s   Nones   __init__s   pprints   pformats   isrecursives
   isreadables   _PrettyPrinter__formats   _PrettyPrinter__repr(    (    (    s   /usr/lib/python2.2/pprint.pys   PrettyPrinterM s   					Fc    s2  t  |  ƒ } | t j oí d t j o |  d d f Sn d |  j o
 d |  j o d } h  d d <} n d } h  d d <} | i } t	 ƒ  } | i } xD |  D]< } | i ƒ  o | | ƒ n | | | | d d !ƒ ƒ q¢ Wd	 | | i ƒ  | f d d f Sn | t j od|  o d
 d d f Sn t |  ƒ } | o
 | | j o d d | | j f Sn | | j o t |  ƒ d d f Sn d | | <d } d } g  } | i }	 | d 7} t } x– |  i ƒ  D]ˆ \ } } | | | | | ƒ \ } } } | | | | | ƒ \ } } } |	 d | | f ƒ | o | o | } | p | o
 d } n qÉW| | =d t% | ƒ | | f Sn | t& j p
 | t' j ox| t& j o# |  o d d d f Sn d } n= t) |  ƒ d j o
 d } n  |  o d d d f Sn d } t |  ƒ } | o
 | | j o | d d | | j f Sn | | j o t |  ƒ d d f Sn d | | <d } d } g  } | i }	 | d 7} xY |  D]Q } t | | | | ƒ \ }
 } } |	 |
 ƒ | o
 d } n | o
 d } n q’W| | =| t% | ƒ | | f Sn |  } | | o | i/ d ƒ d f Sd  S(   Ns   localei   i    s   's   "s   \"s   \'iÿÿÿÿs   %s%s%ss   {}s   {...}s   %s: %ss   {%s}s   []s   [%s]s   (%s,)s   ()s   (%s)s   ...s   <(0   s   _types   objects   typs
   StringTypes   _sys_moduless   closures   quotess   gets   qgets   StringIOs   sios   writes   chars   isalphas   getvalues   DictTypes   _ids   objids	   maxlevelss   levels   contexts
   _recursions   readables	   recursives
   componentss   appends
   _safe_reprs   safereprs	   iteritemss   ks   vs   kreprs	   kreadables   krecurs   vreprs	   vreadables   vrecurs
   _commajoins   ListTypes	   TupleTypes   formats   _lens   os   oreprs	   oreadables   orecurs   reps
   startswith(   s   objects   contexts	   maxlevelss   levels	   kreadables   chars   quotess   vrecurs   qgets   appends   oreprs   krecurs	   recursives   orecurs   reps   readables   writes   objids   sios   formats   vreprs   typs   closures	   oreadables   ks   os   safereprs	   vreadables
   componentss   vs   krepr(    (    s   /usr/lib/python2.2/pprint.pys
   _safe_reprÑ s˜    			 $
	
 


	
 

c    s!   d t  |  ƒ i t |  ƒ f Sd  S(   Ns   <Recursion on %s with id=%s>(   s   _types   objects   __name__s   _id(   s   object(    (    s   /usr/lib/python2.2/pprint.pys
   _recursion#s    c    s¼   d  k  } |  t j o; d d d f d d g h  d d <d d	 <f g d
 }  n t ƒ  } | i  ƒ  } t |  h  t d ƒ | i  ƒ  } | i |  ƒ | i  ƒ  } d G| | GHd G| | GHd  S(   Ns   stringi   i   i   i   i   i   i   i   i † i    s   _safe_repr:s   pformat:(
   s   times   objects   Nones   PrettyPrinters   ps   t1s
   _safe_reprs   t2s   pformats   t3(   s   objects   ps   times   t2s   t3s   t1(    (    s   /usr/lib/python2.2/pprint.pys
   _perfcheck(s    	;	s   __main__(    s   __doc__s   typess   DictTypes   ListTypes	   TupleTypes
   StringTypes   syss	   cStringIOs   StringIOs   ImportErrors   __all__s   joins
   _commajoins   moduless   _sys_moduless   ids   _ids   lens   _lens   types   _types   Nones   pprints   pformats   safereprs
   isreadables   isrecursives   PrettyPrinters
   _safe_reprs
   _recursions
   _perfchecks   __name__(   s   DictTypes   _types   syss
   _safe_reprs
   isreadables   ListTypes   PrettyPrinters
   _commajoins	   TupleTypes   _sys_moduless
   StringTypes   __all__s   StringIOs   pprints
   _recursions
   _perfchecks   _lens   safereprs   pformats   _ids   isrecursive(    (    s   /usr/lib/python2.2/pprint.pys   ?# s.   							„	R	