Ñò
mÈKc           @   s`   d  Z  d d g Z d d k Z d d k l Z d d d „  ƒ  YZ d „  Z e ƒ  Z e i Z d S(	   sG   Redo the builtin repr() (representation) but with limits on most sizes.t   Reprt   repriÿÿÿÿN(   t   islicec           B   s‰   e  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(   c         C   sg   d |  _  d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _	 d |  _
 d  S(   Ni   i   i   i   i(   i   (   t   maxlevelt   maxtuplet   maxlistt   maxarrayt   maxdictt   maxsett   maxfrozensett   maxdequet	   maxstringt   maxlongt   maxother(   t   self(    (    s   /usr/lib/python2.6/repr.pyt   __init__
   s    										c         C   s   |  i  | |  i ƒ S(   N(   t   repr1R   (   R   t   x(    (    s   /usr/lib/python2.6/repr.pyR      s    c         C   sï   t  | ƒ i } d | j o | i ƒ  } d i | ƒ } n t |  d | ƒ o t |  d | ƒ | | ƒ S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   typet   __name__t   splitt   joint   hasattrt   getattrt   __builtin__R   t   lenR   t   max(   R   R   t   levelt   typenamet   partst   st   it   j(    (    s   /usr/lib/python2.6/repr.pyR      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   R   t   appendR   (   R   R   R   t   leftt   rightt   maxitert   trailt   nR!   t   newlevelR   t   _[1]t   elemt   pieces(    (    s   /usr/lib/python2.6/repr.pyt   _repr_iterable)   s    

	3  c         C   s   |  i  | | d d |  i d ƒ S(   Nt   (t   )t   ,(   R/   R   (   R   R   R   (    (    s   /usr/lib/python2.6/repr.pyt
   repr_tuple6   s    c         C   s   |  i  | | d d |  i ƒ S(   Nt   [t   ](   R/   R   (   R   R   R   (    (    s   /usr/lib/python2.6/repr.pyt	   repr_list9   s    c         C   s)   d | i  } |  i | | | d |  i ƒ S(   Ns   array('%s', [s   ])(   t   typecodeR/   R   (   R   R   R   t   header(    (    s   /usr/lib/python2.6/repr.pyt
   repr_array<   s    c         C   s(   t  | ƒ } |  i | | d d |  i ƒ S(   Ns   set([s   ])(   t   _possibly_sortedR/   R   (   R   R   R   (    (    s   /usr/lib/python2.6/repr.pyt   repr_set@   s    c         C   s(   t  | ƒ } |  i | | d d |  i ƒ S(   Ns   frozenset([s   ])(   R:   R/   R	   (   R   R   R   (    (    s   /usr/lib/python2.6/repr.pyt   repr_frozensetD   s    c         C   s   |  i  | | d d |  i ƒ S(   Ns   deque([s   ])(   R/   R
   (   R   R   R   (    (    s   /usr/lib/python2.6/repr.pyt
   repr_dequeI   s    c         C   sà   t  | ƒ } | d j o d S| d j o d S| d } |  i } g  } xY t t | ƒ |  i ƒ D]? } | | | ƒ } | | | | ƒ }	 | i d | |	 f ƒ qb 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*   R+   R   R.   t   keyt   keyreprt   valreprR!   (    (    s   /usr/lib/python2.6/repr.pyt	   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#   (    (    s   /usr/lib/python2.6/repr.pyt   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#   (    (    s   /usr/lib/python2.6/repr.pyt	   repr_longd   s    $c         C   s²   y t  i | ƒ } Wn* t j
 o d | i i t | ƒ f S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   t	   Exceptiont	   __class__R   t   idR   R   R   (   R   R   R   R!   R"   R#   (    (    s   /usr/lib/python2.6/repr.pyt   repr_instancel   s    $(   R   t
   __module__R   R   R   R/   R3   R6   R9   R;   R<   R=   RA   RB   RC   RG   (    (    (    s   /usr/lib/python2.6/repr.pyR       s   													c         C   s/   y t  |  ƒ SWn t j
 o t |  ƒ SXd  S(   N(   t   sortedRD   t   list(   R   (    (    s   /usr/lib/python2.6/repr.pyR:   z   s    (    (	   t   __doc__t   __all__R   t	   itertoolsR   R    R:   t   aReprR   (    (    (    s   /usr/lib/python2.6/repr.pyt   <module>   s   r			