%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/pprint.pyc

ó
Mêáac@sdZddlZddlZyddlmZWn!ek
rUddlmZnXdddddd	gZd
j	Z
eZe
ZeZddddd
„Zdddd„Zd„Zd„Zd„Zd„Zd	dd„ƒYZd„Zd„Zdd„ZedkreƒndS(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.stdout].

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

iÿÿÿÿN(tStringIOtpprinttpformatt
isreadabletisrecursivetsafereprt
PrettyPrinters, iiPc	Cs2td|d|d|d|ƒ}|j|ƒdS(sAPretty-print a Python object to a stream [default is sys.stdout].tstreamtindenttwidthtdepthN(RR(tobjectRRR	R
tprinter((s"/usr/local/lib/python2.7/pprint.pyR7scCs"td|d|d|ƒj|ƒS(s<Format a Python object into a pretty-printed representation.RR	R
(RR(RRR	R
((s"/usr/local/lib/python2.7/pprint.pyR=scCst|iddƒdS(s=Version of repr() which can handle recursive data structures.iN(t
_safe_reprtNone(R((s"/usr/local/lib/python2.7/pprint.pyRAscCst|iddƒdS(s4Determine if saferepr(object) is readable by eval().iiN(R
R(R((s"/usr/local/lib/python2.7/pprint.pyREscCst|iddƒdS(s8Determine if object requires a recursive representation.iiN(R
R(R((s"/usr/local/lib/python2.7/pprint.pyRIscCs@tjƒ.tjr,tjddtƒnt|ƒSWdQXdS(Ntignores%comparing unequal types not supported(twarningstcatch_warningst_systpy3kwarningtfilterwarningstDeprecationWarningtsorted(titerable((s"/usr/local/lib/python2.7/pprint.pyt_sortedMs

	
cBs\eZddd
d
d„Zd„Zd„Zd„Zd„Zd„Zd„Z	d	„Z
RS(iiPcCs©t|ƒ}t|ƒ}|dks0tdƒ‚|dksT|dksTtdƒ‚|sftdƒ‚||_||_||_|dk	r™||_ntj|_dS(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.

        isindent must be >= 0sdepth must be > 0swidth must be != 0N(	tinttAssertionErrorRt_deptht_indent_per_levelt_widtht_streamRtstdout(tselfRR	R
R((s"/usr/local/lib/python2.7/pprint.pyt__init__Us$			cCs3|j||jddidƒ|jjdƒdS(Nis
(t_formatRtwrite(R R((s"/usr/local/lib/python2.7/pprint.pyRtscCs/tƒ}|j||ddidƒ|jƒS(Ni(t	_StringIOR"tgetvalue(R Rtsio((s"/usr/local/lib/python2.7/pprint.pyRxs	cCs|j|iddƒdS(Nii(tformat(R R((s"/usr/local/lib/python2.7/pprint.pyR}scCs,|j|iddƒ\}}}|o+|S(Ni(R'(R Rtstreadablet	recursive((s"/usr/local/lib/python2.7/pprint.pyR€s!cCsÒ|d}t|ƒ}||krK|jt|ƒƒt|_t|_dS|j|||dƒ}t|ƒ}	t	|ƒ|j
d||k}
|j}|jrÀ||jkrÀ||ƒdSt|	ddƒ}t|	tƒr„|tjkr„|dƒ|jdkr!||jddƒnt	|ƒ}
|
rvd||<||j}t|jƒƒ}|d\}}|j|||ƒ}||ƒ|dƒ|j|||t	|ƒd|d||ƒ|
dkr_x|dD]~\}}|j|||ƒ}|
r|dd||fƒn|d	|ƒ|j|||t	|ƒd|d||ƒqÚWn||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}nvt|	tƒrL|d
ƒd}nT|
s`||ƒdS||	jƒ|dƒd}|t|	jƒd7}t|ƒ}|jdkrÍ|
rÍ||jddƒn|
rŽd||<||j}|j|d|||d||ƒ|
dkrwxZ|dD]K}|
rF|dd|ƒn
|dƒ|j||||d||ƒq%Wn||j}||=nt|	tƒr¶|
dkr¶|dƒn||ƒdS||ƒdS(Nit__repr__t{t is: is,
%s%s: s, %s: t}t[t]t(t)s([s])s,
s, t,(t_idR#t
_recursiontTruet
_recursivetFalset	_readablet_reprt_typet_lenRRtgetattrRt
issubclasstdictR+RRtitemsR"tlistttupletsett	frozensett__name__tlen(R RRRt	allowancetcontexttleveltobjidtrepttyptsepLinesR#trtlengthR@tkeytenttendchar((s"/usr/local/lib/python2.7/pprint.pyR"„s¤
		!	









	
	










cCsR|j||jƒ|j|ƒ\}}}|s<t|_n|rNt|_n|S(N(R'tcopyRR8R9R6R7(R RRHRItreprR)R*((s"/usr/local/lib/python2.7/pprint.pyR:àscCst||||ƒS(sÈ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.
        (R
(R RRHt	maxlevelsRI((s"/usr/local/lib/python2.7/pprint.pyR'ésN(REt
__module__RR!RRRRR"R:R'(((s"/usr/local/lib/python2.7/pprint.pyRTs					\		c Cs<t|ƒ}|tkrdtjkr:t|ƒttfSd|krhd|krhd}idd6}nd}idd6}|j}tƒ}|j	}	xG|D]?}
|
j
ƒr¼|	|
ƒq|	||
t|
ƒdd!ƒƒqWd||jƒ|fttfSt|d	dƒ}t|tƒr€|tjkr€|sCd
ttfSt|ƒ}|rt||krtdt||kfS||kr“t|ƒttfSd||<t}
t}g}|j}|d7}t}x—t|jƒƒD]ƒ\}}|||||ƒ\}}}|||||ƒ\}}}|d||fƒ|
oF|oF|}
|sU|rÛt}qÛqÛW||=d
t|ƒ|
|fSt|tƒrž|tjks¼t|tƒr|tjkrt|tƒrç|sÞdttfSd}n4t|ƒdkrd}n|sdttfSd}t|ƒ}|rP||krP|dt||kfS||krot|ƒttfSd||<t}
t}g}|j}|d7}xT|D]L}t||||ƒ\}}}||ƒ|sât}
n|r¥t}q¥q¥W||=|t|ƒ|
|fSt|ƒ}||o5|jdƒtfS(Ntlocalet't"s\"s\'iiÿÿÿÿs%s%s%sR+s{}s{...}s%s: %ss{%s}s[]s[%s]s(%s,)s()s(%s)s...t<(R;tstrRtmodulesRTR6R8tgetR$R#tisalphaR%R=RR>R?R+R4R5tappendR
RR@t
_commajoinRARBR<t
startswith( RRHRURIRLtclosuretquotestqgetR&R#tcharRNRJR)R*t
componentsR_Rtktvtkreprt	kreadabletkrecurtvreprt	vreadabletvrecurR'totoreprt	oreadabletorecurRK((s"/usr/local/lib/python2.7/pprint.pyR
ós–
			

$ 

	


		

	


	
cCsdt|ƒjt|ƒfS(Ns<Recursion on %s with id=%s>(R;RER4(R((s"/usr/local/lib/python2.7/pprint.pyR5GscCs³ddl}|dkrHddddgidd6d	d
6fgd}ntƒ}|jƒ}t|iddƒ|jƒ}|j|ƒ|jƒ}d
G||GHdG||GHdS(Niÿÿÿÿtstringiiiiiiiii †is_safe_repr:spformat:(ii(ttimeRRR
R(RRttptt1tt2tt3((s"/usr/local/lib/python2.7/pprint.pyt
_perfcheckLs0	

t__main__((t__doc__tsysRRt	cStringIORR$tImportErrort__all__tjoinR`tidR4RFR<ttypeR;RRRRRRRRR
R5RyRE(((s"/usr/local/lib/python2.7/pprint.pyt<module>#s0
						Ÿ	T	


Zerion Mini Shell 1.0