403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/lib2to3/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/lib2to3/fixer_util.pyc
ó
—|_c
@sdZddlmZddlmZddlmZmZddlm	Z
ddlmZd„Z
d	„Zd
„Zd„Zd4d„Zd
„Zd„Zd„Zeƒeƒd„Zd4d4d„Zd„Zd„Zd4d„Zd„Zd4d„Zd4d„Zd„Zd„Zd„Z d„Z!e"ddddd d!d"d#d$g	ƒZ#d%„Z$d&a%d'a&d(a'e(a)d)„Z*d*„Z+d+„Z,d,„Z-d-„Z.d.„Z/d/„Z0d0„Z1e"e
j2e
j3gƒZ4d4d1„Z5e"e
j3e
j2e
j6gƒZ7d2„Z8d4d3„Z9d4S(5s1Utility functions, node construction macros, etc.i˙˙˙˙(tislicei(ttoken(tLeaftNode(tpython_symbols(tpatcompcCs%ttj|ttjdƒ|gƒS(Nu=(RtsymstargumentRRtEQUAL(tkeywordtvalue((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt
KeywordArgs	cCsttjdƒS(Nu((RRtLPAR(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytLParenscCsttjdƒS(Nu)(RRtRPAR(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytRParenscCslt|tƒs|g}nt|tƒs?d|_|g}nttj|ttjdddƒg|ƒS(sBuild an assignment statementu u=tprefix(	t
isinstancetlistRRRtatomRRR(ttargettsource((s(/usr/lib/python2.7/lib2to3/fixer_util.pytAssigns		cCsttj|d|ƒS(sReturn a NAME leafR(RRtNAME(tnameR((s(/usr/lib/python2.7/lib2to3/fixer_util.pytName&scCs|ttjtƒ|gƒgS(sA node tuple for obj.attr(RRttrailertDot(tobjtattr((s(/usr/lib/python2.7/lib2to3/fixer_util.pytAttr*scCsttjdƒS(sA comma leafu,(RRtCOMMA(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytComma.scCsttjdƒS(sA period (.) leafu.(RRtDOT(((s(/usr/lib/python2.7/lib2to3/fixer_util.pyR2scCsMttj|jƒ|jƒgƒ}|rI|jdttj|ƒƒn|S(s-A parenthesised argument list, used by Call()i(RRRtclonetinsert_childtarglist(targstlparentrparentnode((s(/usr/lib/python2.7/lib2to3/fixer_util.pytArgList6s$cCs:ttj|t|ƒgƒ}|dk	r6||_n|S(sA function callN(RRtpowerR)tNoneR(t	func_nameR%RR(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytCall=scCsttjdƒS(sA newline literalu
(RRtNEWLINE(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytNewlineDscCsttjdƒS(sA blank lineu(RRR.(((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt	BlankLineHscCsttj|d|ƒS(NR(RRtNUMBER(tnR((s(/usr/lib/python2.7/lib2to3/fixer_util.pytNumberLscCs1ttjttjdƒ|ttjdƒgƒS(sA numeric or string subscriptu[u](RRRRRtLBRACEtRBRACE(t
index_node((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt	SubscriptOscCsttj|d|ƒS(s
A string leafR(RRtSTRING(tstringR((s(/usr/lib/python2.7/lib2to3/fixer_util.pytStringUsc	Csd|_d|_d|_ttjdƒ}d|_ttjdƒ}d|_||||g}|rŻd|_ttjdƒ}d|_|jttj||gƒƒnttj|ttj	|ƒgƒ}ttj
ttjdƒ|ttjdƒgƒS(suA list comprehension of the form [xp for fp in it if test].

    If test is None, the "if test" part is omitted.
    uu uforuinuifu[u](
RRRRtappendRRtcomp_ift	listmakertcomp_forRR4R5(	txptfptitttesttfor_leaftin_leaft
inner_argstif_leaftinner((s(/usr/lib/python2.7/lib2to3/fixer_util.pytListCompYs$							"$	cCsx|D]}|jƒqWttjdƒttj|ddƒttjdddƒttj|ƒg}ttj|ƒ}|S(sO Return an import statement in the form:
        from package import name_leafsufromRu uimport(tremoveRRRRRtimport_as_namestimport_from(tpackage_namet
name_leafstleaftchildrentimp((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt
FromImportqs
c	Csžt|tƒr.|jtƒtƒgkr.tSt|tƒo˝t|jƒdko˝t|jdtƒo˝t|jdtƒo˝t|jdtƒo˝|jdjdko˝|jdjdkS(s(Does the node represent a tuple literal?iiiiu(u)(	RRROR
RtTruetlenRR
(R(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytis_tuple‰s*cCszt|tƒoyt|jƒdkoyt|jdtƒoyt|jdtƒoy|jdjdkoy|jdjdkS(s'Does the node represent a list literal?iii˙˙˙˙u[u](RRRSRORR
(R(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytis_list•scCsttjtƒ|tƒgƒS(N(RRRR
R(R(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytparenthesizeŁstsortedRtsettanytallttupletsumtmintmaxccs4t||ƒ}x|r/|Vt||ƒ}qWdS(slFollow an attribute chain.

    If you have a chain of objects where a.foo -> b, b.foo-> c, etc,
    use this to iterate over all objects in the chain. Iteration is
    terminated by getattr(x, attr) is None.

    Args:
        obj: the starting object
        attr: the name of the chaining attribute

    Yields:
        Each successive object in the chain.
    N(tgetattr(RRtnext((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt
attr_chainŞs	sefor_stmt< 'for' any 'in' node=any ':' any* >
        | comp_for< 'for' any 'in' node=any any* >
     sĽ
power<
    ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'sum' |
      'any' | 'all' | (any* trailer< '.' 'join' >) )
    trailer< '(' node=any ')' >
    any*
>
sN
power<
    'sorted'
    trailer< '(' arglist<node=any any*> ')' >
    any*
>
cCs¤ts<tjtƒatjtƒatjtƒatantttg}xRt|t|dƒƒD]8\}}i}|j	||ƒrd|d|krdtSqdWt
S(s Returns true if node is in an environment where all that is required
        of it is being itterable (ie, it doesn't matter if it returns a list
        or an itterator).
        See test_map_nochange in test_fixers.py for some examples and tests.
        tparentR((t
pats_builtRtcompile_patterntp1tp0tp2RRtzipRatmatchtFalse(R(tpatternstpatternRbtresults((s(/usr/lib/python2.7/lib2to3/fixer_util.pytin_special_contextĐs	%"cCsŮ|j}|dk	r+|jtjkr+tS|j}|jtjtj	fkrStS|jtj
kr||jd|kr|tS|jtjksŃ|jtj
krŐ|dk	rž|jtjksŃ|jd|krŐtStS(sG
    Check that something isn't an attribute or function name etc.
    iN(tprev_siblingR+ttypeRR!RjRbRtfuncdeftclassdeft	expr_stmtROt
parameterst
typedargslistRRR(R(tprevRb((s(/usr/lib/python2.7/lib2to3/fixer_util.pytis_probably_builtinăs		%cCspxi|dk	rk|jtjkr_t|jƒdkr_|jd}|jtjkr_|jSn|j	}qWdS(sFind the indentation of *node*.iiuN(
R+RpRtsuiteRSRORtINDENTR
Rb(R(tindent((s(/usr/lib/python2.7/lib2to3/fixer_util.pytfind_indentationús'


cCsW|jtjkr|S|jƒ}|jd}|_ttj|gƒ}||_|S(N(RpRRxR"RbR+R(R(RbRx((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt
make_suites	cCs;x4|jtjkr6|js*tdƒ‚|j}qW|S(sFind the top level namespace.s<Tree is insane! root found before file_input node was found.(RpRt
file_inputRbtAssertionError(R(((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt	find_roots
cCs"t|t|ƒ|ƒ}t|ƒS(sŢ Returns true if name is imported from package at the
        top level of the tree which node belongs to.
        To cover the case of an import like 'import foo', use
        None for the package and 'foo' for the name. (tfind_bindingRtbool(tpackageRR(tbinding((s(/usr/lib/python2.7/lib2to3/fixer_util.pytdoes_tree_importscCs|jtjtjfkS(s0Returns true if the node is an import statement.(RpRtimport_nameRK(R(((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt	is_import"scCsŻd„}t|ƒ}t|||ƒr+dSd}}xnt|jƒD]]\}}||ƒscqEnx1t|j|ƒD]\}}||ƒswPqwqwW||}PqEW|dkrxbt|jƒD]N\}}|jtjkrÂ|jrÂ|jdjtjkrÂ|d}PqÂqÂWn|dkr\t
tjttj
dƒttj
|ddƒgƒ}	n$t|ttj
|ddƒgƒ}	|	tƒg}
|j|t
tj|
ƒƒdS(s\ Works like `does_tree_import` but adds an import statement
        if it was not imported. cSs,|jtjko+|jo+t|jdƒS(Ni(RpRtsimple_stmtROR†(R(((s(/usr/lib/python2.7/lib2to3/fixer_util.pytis_import_stmt)sNiiuimportRu (RR„t	enumerateRORpRR‡RR8R+RR…RRRQR/R#(R‚RR(Rˆtroott
insert_postoffsettidxtnode2timport_RO((s(/usr/lib/python2.7/lib2to3/fixer_util.pyttouch_import&s4	
 

	!$c	CsKxD|jD]9}d}|jtjkrst||jdƒrB|St|t|jdƒ|ƒ}|r |}q n­|jtjtj	fkrżt|t|jdƒ|ƒ}|r |}q na|jtj
kr|t|t|jdƒ|ƒ}|r˙|}q xt|jdƒD]b\}}|jtj
kr|jdkrt|t|j|dƒ|ƒ}|ru|}quqqWn¤|jtkrŞ|jdj|krŞ|}nvt|||ƒrĹ|}n[|jtjkrět|||ƒ}n4|jtjkr t||jdƒr |}q n|r
|s0|St|ƒrC|Sq
q
WdS(	sş Returns the node which binds variable name, otherwise None.
        If optional argument package is supplied, only imports will
        be returned.
        See test cases for examples.ii˙˙˙˙iit:iiN(ROR+RpRtfor_stmtt_findR€R|tif_stmtt
while_stmtttry_stmtR‰RtCOLONR
t	_def_symst_is_import_bindingR‡RsR†(RR(R‚tchildtretR2titkid((s(/usr/lib/python2.7/lib2to3/fixer_util.pyR€TsH	 !#%		cCs||g}xl|rw|jƒ}|jdkrO|jtkrO|j|jƒq|jtjkr|j|kr|SqWdS(Ni(	tpopRpt_block_symstextendRORRR
R+(RR(tnodes((s(/usr/lib/python2.7/lib2to3/fixer_util.pyR“s		!cCs'|jtjkr|r|jd}|jtjkrŁxÔ|jD]Z}|jtjkrw|jdj|krœ|SqB|jtjkrB|j|krB|SqBWq#|jtjkrę|jd}|jtjkr|j|kr|Sq#|jtjkr#|j|kr#|Sn|jtj	kr#|rMt
|jdƒjƒ|krMdS|jd}|rst
d|ƒrsdS|jtjkr˜t
||ƒr˜|S|jtjkrß|jd}|jtjkr |j|kr |Sq#|jtjkr|j|kr|S|r#|jtjkr#|SndS(s› Will reuturn node if node will import name, or node
        will import * from package.  None is returned otherwise.
        See test cases for examples. iii˙˙˙˙iuasN(RpRR…ROtdotted_as_namestdotted_as_nameR
RRRKtunicodetstripR+R“RJtimport_as_nametSTAR(R(RR‚RPRštlastR2((s(/usr/lib/python2.7/lib2to3/fixer_util.pyR™‰s@
!
!!%
!
!!N(:t__doc__t	itertoolsRtpgen2RtpytreeRRtpygramRRtRRR
RRR+RRR RR)R-R/R0R3R7R:RHRQRTRURVRXtconsuming_callsRaRfReRgRjRcRnRwR{R|RR„R†RRrRqR˜R€RRŸR“R™(((s(/usr/lib/python2.7/lib2to3/fixer_util.pyt<module>sZ																									-*	

Youez - 2016 - github.com/yon3zu
LinuXploit