AlkantarClanX12

Your IP : 18.227.49.73


Current Path : /usr/lib64/python2.7/Demo/parser/
Upload File :
Current File : //usr/lib64/python2.7/Demo/parser/unparse.pyc

�
��^c@s�dZddlZddlZddlZddlZdeejjd�Zd�Z	dfd��YZ
ejd�Zd	�Z
d
�Zedkr�eejd�ndS(s'Usage: unparse.py <path to source file>i����Nt1eicCsZt|�}y|t|��Wntk
r3n#Xx|D]}|�||�q;WdS(s<Call f on each item in seq, calling inter() in between.
    N(titertnextt
StopIteration(tintertftseqtx((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt
interleaves

tUnparsercBseZdZejd�Zdd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d �Z#d!�Z$d"�Z%d#�Z&d$�Z'd%�Z(d&�Z)d'�Z*d(�Z+d)�Z,d*�Z-d+�Z.d,�Z/d-�Z0d.�Z1d/�Z2id0d16d2d36d4d56d6d76Z3d8�Z4id4d96d6d:6d;d<6d=d>6d?d@6dAdB6dCdD6dEdF6dGdH6dIdJ6dKdL6dMdN6Z5dO�Z6i
dPdQ6dRdS6dTdU6dVdW6dXdY6dZd[6d\d]6d^d_6d`da6dbdc6Z7dd�Z8idee9j:6dfe9j;6Z<dg�Z=dh�Z>di�Z?dj�Z@dk�ZAdl�ZBdm�ZCdn�ZDdo�ZEdp�ZFdq�ZGdr�ZHRS(ss�Methods in this class recursively traverse an AST and
    output source code for the abstract syntax; original formatting
    is disregarded. cCsI||_g|_d|_|j|�|jjd�|jj�dS(sTUnparser(tree, file=sys.stdout) -> None.
         Print the source for tree to file.itN(Rtfuture_importst_indenttdispatchtwritetflush(tselfttreetfile((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt__init__s			
R
cCs#|jjdd|j|�dS(sBIndent a piece of text, according to the current indentation levels
s    N(RRR(Rttext((s+/usr/lib64/python2.7/Demo/parser/unparse.pytfill'scCs|jj|�dS(s+Append a piece of text to the current line.N(RR(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyR+scCs |jd�|jd7_dS(s(Print ':', and increase the indentation.t:iN(RR(R((s+/usr/lib64/python2.7/Demo/parser/unparse.pytenter/s
cCs|jd8_dS(sDecrease the indentation level.iN(R(R((s+/usr/lib64/python2.7/Demo/parser/unparse.pytleave4scCsXt|t�r1x|D]}|j|�qWdSt|d|jj�}||�dS(s:Dispatcher function, dispatching tree type T to method _T.Nt_(t
isinstancetlistR
tgetattrt	__class__t__name__(RRtttmeth((s+/usr/lib64/python2.7/Demo/parser/unparse.pyR
8s
cCs%x|jD]}|j|�q
WdS(N(tbodyR
(RRtstmt((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_ModuleIscCs|j�|j|j�dS(N(RR
tvalue(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_ExprNs
cs0�jd�t�fd��j|j�dS(Nsimport cs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyt<lambda>TR
(RRR
tnames(RR((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_ImportRs
cs�|jr8|jdkr8�jjd�|jD��n�jd��jd|j�|jru�j|j�n�jd�t�fd��j|j�dS(Nt
__future__css|]}|jVqdS(N(tname(t.0tn((s+/usr/lib64/python2.7/Demo/parser/unparse.pys	<genexpr>Yssfrom t.s import cs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&`R
(	tmoduleRtextendR'RRtlevelRR
(RR((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_ImportFromVs 
	
cCsL|j�x+|jD] }|j|�|jd�qW|j|j�dS(Ns = (RttargetsR
RR$(RRttarget((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Assignbs


cCsS|j�|j|j�|jd|j|jjjd�|j|j�dS(Nt s= (	RR
R3RtbinoptopRRR$(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt
_AugAssignis
%cCs:|jd�|jr6|jd�|j|j�ndS(NtreturnR5(RR$RR
(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Returnos
	
cCs|jd�dS(Ntpass(R(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_PassuscCs|jd�dS(Ntbreak(R(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_BreakxscCs|jd�dS(Ntcontinue(R(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt	_Continue{scs0�jd�t�fd��j|j�dS(Nsdel cs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&�R
(RRR
R2(RR((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Delete~s
cCsJ|jd�|j|j�|jrF|jd�|j|j�ndS(Nsassert s, (RR
ttesttmsgR(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Assert�s

	
cCss|jd�|j|j�|jrF|jd�|j|j�n|jro|jd�|j|j�ndS(Nsexec s in s, (RR
R!tglobalsRtlocals(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Exec�s
	
	
cCs�|jd�t}|jrB|jd�|j|j�t}nx:|jD]/}|rh|jd�nt}|j|�qLW|js�|jd�ndS(Nsprint s>>s, t,(RtFalsetdestRR
tTruetvaluestnl(RRtdo_commate((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Print�s
	
		cs0�jd�t�fd��j|j�dS(Nsglobal cs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&�R
(RRRR'(RR((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Global�s
cCsT|jd�|jd�|jrC|jd�|j|j�n|jd�dS(Nt(tyieldR5t)(RR$R
(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Yield�s

	
cCs|jd�|jr)|j|j�n|jrR|jd�|j|j�n|jr{|jd�|j|j�ndS(Nsraise s, (RttypeR
tinstRttback(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Raise�s
		
	
cCs�|jd�|j�|j|j�|j�x|jD]}|j|�q;W|jr�|jd�|j�|j|j�|j�ndS(Nttrytelse(RRR
R!Rthandlerstorelse(RRtex((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt
_TryExcept�s


	

cCs�t|j�dkrAt|jdtj�rA|j|j�n1|jd�|j�|j|j�|j�|jd�|j�|j|j	�|j�dS(NiiRZtfinally(
tlenR!Rtastt	TryExceptR
RRRt	finalbody(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_TryFinally�s.




cCs�|jd�|jr6|jd�|j|j�n|jr_|jd�|j|j�n|j�|j|j�|j�dS(NtexceptR5s as (RRVRR
R*RR!R(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_ExceptHandler�s
	
	

cCs�|jd�x+|jD] }|jd�|j|�qW|jd|j�|jr�|jd�x+|jD] }|j|�|jd�qoW|jd�n|j�|j|j�|j�dS(Ns
t@sclass RRs, RT(	Rtdecorator_listRR
R*tbasesRR!R(RRtdecota((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt	_ClassDef�s

	


cCs�|jd�x+|jD] }|jd�|j|�qW|jd|jd�|j|j�|jd�|j�|j|j�|j�dS(Ns
Rhsdef RRRT(	RRiRR
R*targsRR!R(RRRk((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_FunctionDef�s



cCs�|jd�|j|j�|jd�|j|j�|j�|j|j�|j�|jr�|jd�|j�|j|j�|j�ndS(Nsfor s in R[(	RR
R3RRRR!RR](RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_For�s



	

cCs|jd�|j|j�|j�|j|j�|j�x�|jr�t|j�dkr�t|jdt	j
�r�|jd}|jd�|j|j�|j�|j|j�|j�qDW|jr
|jd�|j�|j|j�|j�ndS(Nsif iiselif R[(RR
RBRR!RR]RaRRbtIf(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Ifs$


!


	

cCs�|jd�|j|j�|j�|j|j�|j�|jr~|jd�|j�|j|j�|j�ndS(Nswhile R[(RR
RBRR!RR](RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_While!s


	

cCsn|jd�|j|j�|jrF|jd�|j|j�n|j�|j|j�|j�dS(Nswith s as (RR
tcontext_exprt
optional_varsRRR!R(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_With-s
	

cCs�d|jkr(|jt|j��nut|jt�rW|jdt|j��nFt|jt�r�|jt|j�jd��nts�t	d��dS(Ntunicode_literalstbtusshouldn't get here(
RRtreprtsRtstrtunicodetlstripRItAssertionError(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Str8s"cCs|j|j�dS(N(Rtid(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_NameEscCs.|jd�|j|j�|jd�dS(Nt`(RR
R$(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_ReprHs
cCsjt|j�}|jd�r.|jd�n|j|jdt��|jd�rf|jd�ndS(Nt-RRtinfRT(RzR,t
startswithRtreplacetINFSTR(RRtrepr_n((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_NumMscs=�jd�t�fd��j|j��jd�dS(Nt[cs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&YR
t](RRR
telts(RR((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_ListWs
cCsO|jd�|j|j�x|jD]}|j|�q'W|jd�dS(NR�R�(RR
teltt
generators(RRtgen((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt	_ListComp\s

cCsO|jd�|j|j�x|jD]}|j|�q'W|jd�dS(NRRRT(RR
R�R�(RRR�((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt
_GeneratorExpcs

cCsO|jd�|j|j�x|jD]}|j|�q'W|jd�dS(Nt{t}(RR
R�R�(RRR�((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_SetCompjs

cCsl|jd�|j|j�|jd�|j|j�x|jD]}|j|�qDW|jd�dS(NR�s: R�(RR
tkeyR$R�(RRR�((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt	_DictCompqs

cCsl|jd�|j|j�|jd�|j|j�x+|jD] }|jd�|j|�qDWdS(Ns for s in s if (RR
R3Rtifs(RRt	if_clause((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_comprehensionzs


cCsh|jd�|j|j�|jd�|j|j�|jd�|j|j�|jd�dS(NRRs if s else RT(RR
R!RBR](RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_IfExp�s


csL|jst��jd�t�fd��j|j��jd�dS(NR�cs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&�R
R�(R�RRRR
(RR((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Set�s
csU�jd��fd�}t�fd�|t|j|j���jd�dS(NR�cs7|\}}�j|��jd��j|�dS(Ns: (R
R(tpairtktv(R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyt
write_pair�s

cs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&�R
R�(RRtziptkeysRL(RRR�((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Dict�s
(cs{�jd�t|j�dkrK|j\}�j|��jd�nt�fd��j|j��jd�dS(NRRiRHcs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&�R
RT(RRaR�R
R(RRR�((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Tuple�s

t~tInverttnottNott+tUAddR�tUSubcCs�|jd�|j|j|jjj�|jd�t|jtj�r�t|jtj	�r�|jd�|j
|j�|jd�n|j
|j�|jd�dS(NRRR5RT(RtunopR7RRRRbR�toperandtNumR
(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_UnaryOp�s

*
tAddtSubt*tMultt/tDivt%tMods<<tLShifts>>tRShiftt|tBitOrt^tBitXort&tBitAnds//tFloorDivs**tPowcCsc|jd�|j|j�|jd|j|jjjd�|j|j�|jd�dS(NRRR5RT(RR
tleftR6R7RRtright(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_BinOp�s

%s==tEqs!=tNotEqt<tLts<=tLtEt>tGts>=tGtEtistIssis nottIsNottintInsnot intNotIncCs�|jd�|j|j�xRt|j|j�D];\}}|jd|j|jjd�|j|�q3W|jd�dS(NRRR5RT(	RR
R�R�topstcomparatorstcmpopsRR(RRtoRO((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Compare�s
""tandtorcsW�jd�d�j|jj�t��fd��j|j��jd�dS(NRRs %s cs
�j��S(N(R((R{R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&�R
RT(RtboolopsR7RRR
RL(RR((R{Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt_BoolOp�s
"cCsk|j|j�t|jtj�rJt|jjt�rJ|jd�n|jd�|j|j�dS(NR5R-(	R
R$RRbR�R,tintRtattr(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt
_Attribute�s
*
cCs8|j|j�|jd�t}x:|jD]/}|rI|jd�nt}|j|�q-Wx:|jD]/}|r�|jd�nt}|j|�qjW|jr�|r�|jd�nt}|jd�|j|j�n|jr'|r|jd�nt}|jd�|j|j�n|jd�dS(NRRs, R�s**RT(	R
tfuncRRIRnRKtkeywordststarargstkwargs(RRtcommaRO((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Call�s4
	
	
cCs>|j|j�|jd�|j|j�|jd�dS(NR�R�(R
R$Rtslice(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt
_Subscript�s
cCs|jd�dS(Ns...(R(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt	_Ellipsis�scCs|j|j�dS(N(R
R$(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Index�scCsr|jr|j|j�n|jd�|jrE|j|j�n|jrn|jd�|j|j�ndS(NR(tlowerR
Rtuppertstep(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Slices	
		
cs#t�fd��j|j�dS(Ncs
�jd�S(Ns, (R((R(s+/usr/lib64/python2.7/Demo/parser/unparse.pyR&
R
(RR
tdims(RR((Rs+/usr/lib64/python2.7/Demo/parser/unparse.pyt	_ExtSlicescCs't}dgt|j�t|j�|j}xot|j|�D][\}}|r^t}n
|jd�|j|�f|rC|jd�|j|�qCqCW|j	r�|r�t}n
|jd�|jd�|j|j	�n|j
r#|r�t}n
|jd�|jd|j
�ndS(Ns, t=R�s**(RKtNoneRaRntdefaultsR�RIRR
tvarargtkwarg(RRtfirstR�Rltd((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt
_argumentss**	

		

		
cCs1|j|j�|jd�|j|j�dS(NR�(RtargR
R$(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_keyword)s
cCsX|jd�|jd�|j|j�|jd�|j|j�|jd�dS(NRRslambda s: RT(RR
RnR!(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_Lambda.s


cCs4|j|j�|jr0|jd|j�ndS(Ns as (RR*tasname(RR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt_alias6s	(IRt
__module__t__doc__tsyststdoutRRRRRR
R#R%R(R1R4R8R:R<R>R@RARDRGRPRQRURYR_ReRgRmRoRpRrRsRvR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R6R�R�R�RbtAndtOrR�R�R�R�R�R�R�R�R�R�R�R�R�(((s+/usr/lib64/python2.7/Demo/parser/unparse.pyR	s�
																	
														
			
												
	
"	&#	-			
					
				cCsMt|d��}|j�}WdQXt||dtj�}t||�dS(Ntrtexec(topentreadtcompileRbt
PyCF_ONLY_ASTR	(tfilenametoutputtpyfiletsourceR((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt	roundtrip;scCsy5gtj|�D]}|jd�r|^q}Wn%tk
r\tjjd|�n�Xx�|D]�}tjj||�}tjj	|�r�t
j�}d|GHyt||�Wq�t
k
r�}dt|�GHq�Xqdtjj|�rdt|�qdqdWdS(Ns.pysDirectory not readable: %ss
Testing %ss$  Failed to compile, exception is %s(tostlistdirtendswithtOSErrorRtstderrRtpathtjointisfilet	cStringIOtStringIORt	ExceptionRztisdirttestdir(RlR,R'tfullnameRRO((s+/usr/lib64/python2.7/Demo/parser/unparse.pyRCs5

	cCsQ|ddkr2x:|dD]}t|�qWnx|D]}t|�q9WdS(Nis	--testdiri(RR(RnRl((s+/usr/lib64/python2.7/Demo/parser/unparse.pytmainUs

t__main__(R�RRbRRRzt
float_infot
max_10_expR�RR	RRRRRtargv(((s+/usr/lib64/python2.7/Demo/parser/unparse.pyt<module>s	
��%