mς
­fIc           @   sQ   d  Z  d d g Z d k Z d k l Z d f  d     YZ e   Z e i Z d S(   s>   Redo the `...` (representation) but with limits on most sizes.t   Reprt   reprN(   s   islicec           B   s   t  Z d   Z d   Z d   Z d d  Z d   Z d   Z d   Z d	   Z	 d
   Z
 d   Z d   Z d   Z d   Z d   Z RS(   Nc         C   sg   d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _	 d |  _
 d |  _ d  S(   Ni   i   i   i   i(   i   (   t   selft   maxlevelt   maxtuplet   maxlistt   maxarrayt   maxdictt   maxsett   maxfrozensett   maxdequet	   maxstringt   maxlongt   maxother(   R   (    (    t!   /mit/python/lib/python2.4/repr.pyt   __init__
   s    										c         C   s   |  i | |  i  S(   N(   R   t   repr1t   xR   (   R   R   (    (    R   R      s    c         C   sς   t  |  i } d | j o | i   } d i |  } n t |  d |  o t	 |  d |  | |  Sn t i |  } t |  |  i j oX t d |  i d d  } t d |  i d |  } | |  d | t |  | } n | Sd  S(   Nt    t   _t   repr_i    i   i   s   ...(   t   typeR   t   __name__t   typenamet   splitt   partst   joint   hasattrR   t   getattrt   levelt   __builtin__R   t   st   lenR   t   maxt   it   j(   R   R   R   R"   R#   R   R   R   (    (    R   R      s    $t    c         C   sΠ   t  |  }	 | d j o |	 o
 d } n | d } |  i } g  }
 t	 | |  D] } |
 | | |  qQ ~
 } |	 | j o | i d  n d i |  } |	 d j o | o | | } n d | | | f S(   Ni    s   ...i   s   , s   %s%s%s(   R    R   t   nR   R   t   newlevelR   R   t   _[1]t   islicet   maxitert   elemt   piecest   appendR   t   trailt   rightt   left(   R   R   R   R/   R.   R)   R-   R&   R*   R%   R'   R   R+   R   (    (    R   t   _repr_iterable)   s    

	3  c         C   s   |  i | | d d |  i d  S(   Nt   (t   )t   ,(   R   R0   R   R   R   (   R   R   R   (    (    R   t
   repr_tuple6   s    c         C   s   |  i | | d d |  i  S(   Nt   [t   ](   R   R0   R   R   R   (   R   R   R   (    (    R   t	   repr_list9   s    c         C   s)   d | i } |  i | | | d |  i  S(   Ns   array('%s', [s   ])(   R   t   typecodet   headerR   R0   R   R   (   R   R   R   R9   (    (    R   t
   repr_array<   s    c         C   s(   t  |  } |  i | | d d |  i  S(   Ns   set([s   ])(   t   sortedR   R   R0   R   R   (   R   R   R   (    (    R   t   repr_set@   s    c         C   s(   t  |  } |  i | | d d |  i  S(   Ns   frozenset([s   ])(   R;   R   R   R0   R   R	   (   R   R   R   (    (    R   t   repr_frozensetD   s    c         C   s   |  i | | d d |  i  S(   Ns   deque([s   ])(   R   R0   R   R   R
   (   R   R   R   (    (    R   t
   repr_dequeI   s    c         C   sζ   t  |  } | d j o d Sn | d j o d Sn | d } |  i }
 g  } xY t t	 |  |  i
  D]? }	 |
 |	 |  } |
 | |	 |  } | i d | | f  qh W| |  i
 j o | i d  n d i |  } d | f S(	   Ni    s   {}s   {...}i   s   %s: %ss   ...s   , s   {%s}(   R    R   R%   R   R&   R   R   R+   R(   R;   R   t   keyt   keyreprt   valreprR,   R   R   (   R   R   R   RA   R@   R&   R%   R   R+   R?   R   (    (    R   t	   repr_dictL   s"      
	  c         C   s­   t  i | |  i   } t |  |  i j o} t d |  i d d  } t d |  i d |  } t  i | |  | t |  |  } | |  d | t |  | } n | S(   Ni    i   i   s   ...(
   R   R   R   R   R   R   R    R!   R"   R#   (   R   R   R   R"   R#   R   (    (    R   t   repr_str[   s    %$c         C   s   t  i |  } t |  |  i j oX t d |  i d d  } t d |  i d |  } | |  d | t |  | } n | S(   Ni    i   i   s   ...(
   R   R   R   R   R    R   R   R!   R"   R#   (   R   R   R   R"   R#   R   (    (    R   t	   repr_longd   s    $c         C   s©   y t  i |  } Wn! d | i i t |  f Sn Xt |  |  i	 j oX t
 d |  i	 d d  } t
 d |  i	 d |  } | |  d | t |  | } n | S(   Ns   <%s instance at %x>i    i   i   s   ...(   R   R   R   R   t	   __class__R   t   idR    R   R   R!   R"   R#   (   R   R   R   R"   R#   R   (    (    R   t   repr_instancel   s    $(   R   t
   __module__R   R   R   R0   R4   R7   R:   R<   R=   R>   RB   RC   RD   RG   (    (    (    R   R       s   													(   t   __doc__t   __all__R   t	   itertoolsR(   R    t   aReprR   (   RL   RJ   R    R   R   R(   (    (    R   t   ?   s   	q	