ó žòœMc@sÄdZddlmZmZmZmZddlZdefd„ƒYZdefd„ƒYZ defd „ƒYZ d efd „ƒYZ d efd „ƒYZ defd„ƒYZ defd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd efd!„ƒYZd"efd#„ƒYZd$efd%„ƒYZd&efd'„ƒYZdS((s5defines the parse tree components for Mako templates.iÿÿÿÿ(t exceptionstasttutiltfiltersNtNodecBs8eZdZd„Zed„ƒZd„Zd„ZRS(s(base class for a Node in the parse tree.cCs(||_||_||_||_dS(N(tsourcetlinenotpostfilename(tselfRRRR((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyt__init__s   cCs,i|jd6|jd6|jd6|jd6S(NRRRR(RRRR(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pytexception_kwargsscCsgS(N((R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyt get_childrenscs9‡fd†}tˆd|jj|ƒ}||ƒdS(Ncs(x!|jƒD]}|jˆƒq WdS(N(R taccept_visitor(tnodetn(tvisitor(s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyttraversestvisit(tgetattrt __class__t__name__(R RRtmethod((Rs4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR s(Rt __module__t__doc__R tpropertyR R R (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR s   t TemplateNodecBs)eZdZd„Zd„Zd„ZRS(s?a 'container' node that stores the overall collection of nodes.cCs5tt|ƒjddd|ƒg|_i|_dS(Nti(tsuperRR tnodestpage_attributes(R R((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR &s cCs|jS(N(R(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR +scCsdtj|jƒ|jfS(NsTemplateNode(%s, %r)(Rtsorted_dict_reprRR(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyt__repr__.s(RRRR R R (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR#s  t ControlLinecBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(s‹defines a control line, a line-oriented python line or end tag. e.g.:: % if foo: (markup) % endif cKstt|ƒj|||_||_||_|dk|_|jr^g|_g|_n-t j ||j }|j |_|j |_dS(Ntfortiftwhilettry(sforsifswhilestry(RR!R ttexttkeywordtisendt is_primaryt_declared_identifierst_undeclared_identifiersRtPythonFragmentR tdeclared_identifierstundeclared_identifiers(R R'R(R&tkwargstcode((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR >s       cCs|jS(N(R*(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-LscCs|jS(N(R+(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR.OscCsO|itddgƒd6tddgƒd6tdgƒd6j|jgƒkS(sRreturn true if the given keyword is a ternary keyword for this ControlLinetelsetelifR#texcepttfinallyR%R"(tsettgetR'(R R'((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyt is_ternaryRs cCs)d|j|j|j|j|jffS(NsControlLine(%r, %r, %r, %r)(R'R&R(RR(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR \s (RRRR R-R.R7R (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR!3s      tTextcBs eZdZd„Zd„ZRS(s#defines plain text in the template.cKs#tt|ƒj|||_dS(N(RR8R tcontent(R R9R/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR gscCsd|j|j|jffS(Ns Text(%r, %r)(R9RR(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ks(RRRR R (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR8ds tCodecBs2eZdZd„Zd„Zd„Zd„ZRS(sÒdefines a Python code block, either inline or module level. e.g.:: inline: <% x = 12 %> module level: <%! import logger %> cKsDtt|ƒj|||_||_tj||j|_dS(N( RR:R R&tismoduleRt PythonCodeR R0(R R&R;R/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR s  cCs |jjS(N(R0R-(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-…scCs |jjS(N(R0R.(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR.ˆscCs#d|j|j|j|jffS(NsCode(%r, %r, %r)(R&R;RR(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ‹s(RRRR R-R.R (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR:ns    tCommentcBs eZdZd„Zd„ZRS(s8defines a comment line. # this is a comment cKs#tt|ƒj|||_dS(N(RR=R R&(R R&R/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ™scCsd|j|j|jffS(NsComment(%r, %r)(R&RR(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR s(RRRR R (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR=’s t ExpressioncBs2eZdZd„Zd„Zd„Zd„ZRS(s1defines an inline expression. ${x+y} cKs\tt|ƒj|||_||_tj||j|_tj ||j|_ dS(N( RR>R R&tescapesRt ArgumentListR t escapes_codeR<R0(R R&R?R/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR §s   cCsgS(N((R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-®scCs@|jjj|jjjttjjƒƒƒƒj|jj ƒS(N( R0R.tunionRAt differenceR5RtDEFAULT_ESCAPEStkeysR-(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR.±s  cCs&d|j|jj|j|jffS(NsExpression(%r, %r, %r)(R&RAtargsRR(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ¹s (RRRR R-R.R (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR> s    t_TagMetacBs&eZdZiZd„Zd„ZRS(sImetaclass to allow Tag to produce a subclass according to its keywordcCsB|jdk r>||j|j <%someothertag> stuff c KsÀtt|ƒj|||_||_|j||ƒg|D]}||jkr?|^q?}t|ƒrªtj ddj g|D]} t | ƒ^q‚ƒ|j ‚nd|_g|_dS(s_construct a new Tag instance. this constructor not called directly, and is only called by subclasses. :param keyword: the tag keyword :param attributes: raw dictionary of attribute key/value pairs :param expressions: a set of identifiers that are legal attributes, which can also contain embedded expressions :param nonexpressions: a set of identifiers that are legal attributes, which cannot contain embedded expressions :param \**kwargs: other arguments passed to the Node superclass (lineno, pos) sMissing attribute(s): %st,N(RRYR R'RVt_parse_attributestparsed_attributestlenRRUtjointreprR RItparentR( R R'RVt expressionstnonexpressionstrequiredR/trtmissingtm((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ës  ( & cCs |jdkS(N(R`RI(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pytis_root scCs|jS(N(R(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR sc Cs¶tƒ}i|_x”|jD]‰}||krg}xÀtjdtjƒj|j|ƒD]™}tjdtjƒj|ƒ}|r×tj |j dƒj ƒ|j }|j |jƒ}|jd|j dƒƒqZ|rZ|jt|ƒƒqZqZWdj|ƒptdƒ|j|s4<%namespace> may only have one of 'file' or 'module'(sfile(snameRsimportsmodule(( RR|R R6thextabstidR~RRUR (R R'RVR/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR as +cCsgS(N((R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-us(RRRHR R-(((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR|^s tTextTagcBseZdZd„ZRS(R&cKsMtt|ƒj||ddd|tj|jddƒ|j|_dS(NtfilterR(((RR„R RR@R6R t filter_args(R R'RVR/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR {s (RRRHR (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR„xstDefTagcBsMeZdZd„ZeZeZed„ƒZd„Z d„Z d„Z RS(tdefc KsÅtt|ƒj||ddd||d}tjd |ƒrYtjd |j‚ntj d |d|j|_ |j j |_ |j d dƒ|_tj|j d dƒ|j|_dS(Ntbufferedtcachedt cache_keyt cache_timeoutt cache_typet cache_dirt cache_urlR~R…t decorators^[\w_]+$sMissing parenthesis in %defsdef s:passR(R‰scachedR‹RŒRRŽR(snamesfilters decorator(sname(RR‡R RhRkRRUR Rt FunctionDeclt function_decltfuncnameR~R6RR@R†(R R'RVR/R~((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ‡s( cCs |jjS(N(R’R“(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR“ scKs|jj|S(N(R’tget_argument_expressions(R tkw((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR”¤scCs |jjS(N(R’targnames(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-§scCseg}x6|jjD](}|ttj||jjƒ7}qW|t|jjjt j j ƒƒƒS(N( R’tdefaultstlistRR<R R.R†RCRRDRE(R trestc((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR.ªs &( RRRHR tFalset is_anonymoustis_blockRR“R”R-R.(((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR‡„s   tBlockTagcBsVeZdZd„ZeZed„ƒZed„ƒZd„Z d„Z d„Z RS(tblockc Kstt|ƒj||ddd||jd ƒ}|retjd |ƒ retjd |j‚n| r–|jddƒr–tjd|j‚nt j |jddƒ|j|_ ||_ |jd dƒ|_t j|jd dƒ|j|_dS(NR‰RŠR‹RŒRRŽRRFR~R…Rs^[\w_]+$s,%block may not specify an argument signatures#Only named %blocks may specify argsR(sbufferedscacheds cache_keys cache_timeouts cache_types cache_dirs cache_urlsargs(snamesfilters decorator((RRžR R6RhRkRRUR RIRt FunctionArgst body_declR~RR@R†(R R'RVR/R~((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ·s0 cCs |jdkS(N(R~RI(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyRœÖscCs|jpd|jfS(Ns __M_anon_%d(R~R(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR“ÚscKs|jj|S(N(R¡R”(R R•((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR”ÞscCs |jjS(N(R¡R–(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-áscCsgS(N((R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR.äs( RRRHR tTrueRRRœR“R”R-R.(((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyRž´s   tCallTagcBs)eZdZd„Zd„Zd„ZRS(tcallcKsutt|ƒj||ddd||d|_tj|j|j|_tj|j ddƒ|j|_ dS(NRFRrR(sexpr(sexpr( RR£R t expressionRR<R R0R R6R¡(R R'RVR/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ês  cCs|jjj|jjƒS(N(R0R-RBR¡R–(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-òscCs|jjj|jjƒS(N(R0R.RCR-(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR.õs (RRRHR R-R.(((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR£çs  RScBs#eZd„Zd„Zd„ZRS(c Ks×tt|ƒj|d||t|jƒƒddd |d||djg|jjƒD](\}}|dkr\d||f^q\ƒf|_t j |j|j |_ t j |jddƒ|j |_dS( NRORFs %s.%s(%s)RZs%s=%sR(sargs(((RRSR ttupleRER^R\t iteritemsR¥RR<R R0R R6R¡(R R}RXRVR/tktv((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR ûs"  ,cCs|jjj|jjƒS(N(R0R-RBR¡R–(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-scCs|jjj|jjƒS(N(R0R.RCR-(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR.s (RRR R-R.(((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyRSùs  t InheritTagcBseZdZd„ZRS(tinheritcKs)tt|ƒj||ddd|dS(NRw(sfile((sfile(RRªR (R R'RVR/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR s(RRRHR (((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyRªstPageTagcBs eZdZd„Zd„ZRS(tpagec Ksqtt|ƒj||d d d |tj|jdd ƒ|j|_tj|jdd ƒ|j|_ dS( NRŠR‹RŒRRŽRRFtexpression_filterR(scacheds cache_keys cache_timeouts cache_types cache_dirs cache_urlsargsR®((( RR¬R RR R6R R¡R@R†(R R'RVR/((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR "scCs |jjS(N(R¡R–(R ((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR-2s(RRRHR R-(((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyR¬s (RtmakoRRRRRhtobjectRRR!R8R:R=R>RQRGRYRuR|R„R‡RžR£RSRªR¬(((s4/usr/lib/python2.7/vendor-packages/mako/parsetree.pyts(" 1 $ j 03