Your IP : 18.119.123.10


Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/pprint.cpython-33.pyo

�
��f�1c@s)dZddlZddlmZddlmZddddd	d
gZ	dj
ZeZ
eZeZddd
ddd�Zdd
ddd�Zdd	�Zdd�Zdd�ZGdd�d�Zdd�ZGdd
�d
�Zdd�Zdd�Zddd�Zedkr%e�ndS(u/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.stdout].

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

iN(uOrderedDict(uStringIOupprintupformatu
isreadableuisrecursiveusaferepru
PrettyPrinteru, iiPc	Cs2td|d|d|d|�}|j|�dS(uAPretty-print a Python object to a stream [default is sys.stdout].ustreamuindentuwidthudepthN(u
PrettyPrinterupprint(uobjectustreamuindentuwidthudepthuprinter((u+/opt/alt/python33/lib64/python3.3/pprint.pyupprint3scCs"td|d|d|�j|�S(u<Format a Python object into a pretty-printed representation.uindentuwidthudepth(u
PrettyPrinterupformat(uobjectuindentuwidthudepth((u+/opt/alt/python33/lib64/python3.3/pprint.pyupformat9scCst|idd�dS(u=Version of repr() which can handle recursive data structures.iN(u
_safe_repruNone(uobject((u+/opt/alt/python33/lib64/python3.3/pprint.pyusaferepr=scCst|idd�dS(u4Determine if saferepr(object) is readable by eval().iiN(u
_safe_repruNone(uobject((u+/opt/alt/python33/lib64/python3.3/pprint.pyu
isreadableAscCst|idd�dS(u8Determine if object requires a recursive representation.iiN(u
_safe_repruNone(uobject((u+/opt/alt/python33/lib64/python3.3/pprint.pyuisrecursiveEscBs;|EeZdZdZdgZdd�Zdd�ZdS(u	_safe_keyuVHelper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to an Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    uobjcCs
||_dS(N(uobj(uselfuobj((u+/opt/alt/python33/lib64/python3.3/pprint.pyu__init__Usu_safe_key.__init__cCs�y|jj|j�}Wntk
r3t}YnX|tkr�tt|j��t|j�ftt|j��t|j�fk}n|S(N(uobju__lt__u	TypeErroruNotImplementedustrutypeuid(uselfuotherurv((u+/opt/alt/python33/lib64/python3.3/pprint.pyu__lt__Xs
!*u_safe_key.__lt__N(u__name__u
__module__u__qualname__u__doc__u	__slots__u__init__u__lt__(u
__locals__((u+/opt/alt/python33/lib64/python3.3/pprint.pyu	_safe_keyIs	u	_safe_keycCst|d�t|d�fS(u&Helper function for comparing 2-tuplesii(u	_safe_key(ut((u+/opt/alt/python33/lib64/python3.3/pprint.pyu_safe_tuplecsu_safe_tuplecBs�|EeZdZdddddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS(u
PrettyPrinteriiPcCs[t|�}t|�}||_||_||_|dk	rK||_ntj|_dS(u�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(uintu_depthu_indent_per_levelu_widthuNoneu_streamu_sysustdout(uselfuindentuwidthudepthustream((u+/opt/alt/python33/lib64/python3.3/pprint.pyu__init__hs			uPrettyPrinter.__init__cCs3|j||jddid�|jjd�dS(Niu
(u_formatu_streamuwrite(uselfuobject((u+/opt/alt/python33/lib64/python3.3/pprint.pyupprint�suPrettyPrinter.pprintcCs/t�}|j||ddid�|j�S(Ni(u	_StringIOu_formatugetvalue(uselfuobjectusio((u+/opt/alt/python33/lib64/python3.3/pprint.pyupformat�s	uPrettyPrinter.pformatcCs|j|idd�dS(Nii(uformat(uselfuobject((u+/opt/alt/python33/lib64/python3.3/pprint.pyuisrecursive�suPrettyPrinter.isrecursivecCs,|j|idd�\}}}|o+|S(Ni(uformat(uselfuobjectusureadableu	recursive((u+/opt/alt/python33/lib64/python3.3/pprint.pyu
isreadable�s!uPrettyPrinter.isreadablecCs�|d}t|�}||krK|jt|��d|_d|_dS|j|||d�}t|�}	t	|�|j
d||k}
|j}|jr�||jkr�||�dS|
r�t|	dd�}t|	t�r�|d�|jdkr||jdd�nt	|�}
|
r�d||<||j}t|	t�ret|j��}nt|j�dt�}|d\}}|j|||�}||�|d�|j|||t	|�d|d||�|
dkrox||dd�D]g\}}|j|||�}|d	d||f�|j|||t	|�d|d||�qWn||j}||=n|d
�dSt|	t�r�|tjkst|	t�r�|tjkst|	t�r�|tjkst|	t�r�|tjkr�t	|�}
t|	t�r:|d�d}n�t|	t�r\|d
�d}ny|
sp||�dS|	tkr�|d�d
}n4||	j�|d�d}|t|	j�d7}t|dt�}|jdkr�||jdd�n|
r�d||<||j}|j|d|||d||�|
dkr�xM|dd�D]8}|dd|�|j||||d||�qZWn||j}||=nt|	t�r�|
dkr�|d�n||�dSn||�dS(Niu__repr__u{u ukeyiu: iu,
%s%s: u}u[u]u(u)u({u})u,
u,TF(u_iduwriteu
_recursionuTrueu
_recursiveuFalseu	_readableu_repru_typeu_lenu_widthu_depthugetattruNoneu
issubclassudictu_indent_per_levelu_OrderedDictulistuitemsusortedu_safe_tupleu_formatu__repr__utupleusetu	frozensetu__name__ulenu	_safe_key(uselfuobjectustreamuindentu	allowanceucontextuleveluobjidureputypusepLinesuwriteurulengthuitemsukeyuentuendchar((u+/opt/alt/python33/lib64/python3.3/pprint.pyu_format�s�
		!	









	
	

	








uPrettyPrinter._formatcCsR|j||j�|j|�\}}}|s<d|_n|rNd|_n|S(NFT(uformatucopyu_depthuFalseu	_readableuTrueu
_recursive(uselfuobjectucontextulevelureprureadableu	recursive((u+/opt/alt/python33/lib64/python3.3/pprint.pyu_repr�suPrettyPrinter._reprcCst||||�S(u�Format object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        (u
_safe_repr(uselfuobjectucontextu	maxlevelsulevel((u+/opt/alt/python33/lib64/python3.3/pprint.pyuformat�suPrettyPrinter.formatN(u__name__u
__module__u__qualname__uNoneu__init__upprintupformatuisrecursiveu
isreadableu_formatu_repruformat(u
__locals__((u+/opt/alt/python33/lib64/python3.3/pprint.pyu
PrettyPrintergs^	c!
Cs0t|�}|tkrdtjkr:t|�ddfSd|krhd|krhd}idd6}nd}idd6}|j}t�}|j	}	xJ|D]B}
|
j
�r�|	|
�q�|	||
t|
�dd���q�Wd||j�|fddfSt|dd�}t|t�r�|tjkr�|s=dSt|�}|rn||krnd
d||kfS||kr�t|�ddfSd||<d}
d}g}|j}|d7}t}t|j�dt�}x�|D]�\}}|||||�\}}}|||||�\}}}|d||f�|
oL|oL|}
|s[|r�d}q�q�W||=d
t|�|
|fSt|t�r�|tjks�t|t�r|tjkrt|t�r�|s�dSd}n+t|�dkr�d}n|s	dSd}t|�}|rD||krD|dd||kfS||krct|�ddfSd||<d}
d}g}|j}|d7}xT|D]L}t||||�\}}}||�|s�d}
n|r�d}q�q�W||=|t|�|
|fSt|�} | | o)| jd�dfS(Nulocaleu'u"u\"u\'iu%s%s%su__repr__u{}u{...}ukeyu%s: %su{%s}u[]u[%s]u(%s,)u()u(%s)u...u<TFi����(u{}TF(u[]TF(u()TF(u_typeustru_sysumodulesurepruTrueuFalseugetu	_StringIOuwriteuisalphaugetvalueugetattruNoneu
issubclassudictu__repr__u_idu
_recursionuappendu
_safe_reprusorteduitemsu_safe_tupleu
_commajoinulistutupleu_lenu
startswith(!uobjectucontextu	maxlevelsulevelutypuclosureuquotesuqgetusiouwriteucharuruobjidureadableu	recursiveu
componentsuappendusaferepruitemsukuvukrepru	kreadableukrecuruvrepru	vreadableuvrecuruformatuouorepru	oreadableuorecururep((u+/opt/alt/python33/lib64/python3.3/pprint.pyu
_safe_reprs�
			

' 
	

		
	


	
u
_safe_reprcCsdt|�jt|�fS(Nu<Recursion on %s with id=%s>(u_typeu__name__u_id(uobject((u+/opt/alt/python33/lib64/python3.3/pprint.pyu
_recursion]su
_recursioncCs�ddl}|dkrHddddgidd6d	d
6fgd}nt�}|j�}t|idd�|j�}|j|�|j�}td||�td
||�dS(Niustringiiiiiiiii��u_safe_repr:upformat:(ii(utimeuNoneu
PrettyPrinteru
_safe_reprupformatuprint(uobjectutimeuput1ut2ut3((u+/opt/alt/python33/lib64/python3.3/pprint.pyu
_perfcheckbs0	
u
_perfchecku__main__(u__doc__usysu_sysucollectionsuOrderedDictu_OrderedDictuiouStringIOu	_StringIOu__all__ujoinu
_commajoinuidu_idulenu_lenutypeu_typeuNoneupprintupformatusaferepru
isreadableuisrecursiveu	_safe_keyu_safe_tupleu
PrettyPrinteru
_safe_repru
_recursionu
_perfchecku__name__(((u+/opt/alt/python33/lib64/python3.3/pprint.pyu<module>#s,		�U


?>