ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ ǚPc @s dZddlZddlZddlmZddlmZmZmZm Z m Z dZ e dddgZ eeeeeeeeefd Zd efd YZd efd YZdefdYZejdZdZdefdYZdS(sVprovides functionality for rendering a parsetree constructing into module source code.iN(t PythonPrinter(tutiltastt parsetreetfilterst exceptionsitcontexttloopt UNDEFINEDc Cstj r+t|tr+|j|}ntj} t| } t| t||||||||| | | || j S(s[Generate module source code given a parsetree node, uri, and optional source filename( Rtpy3kt isinstancetunicodetencodetFastEncodingBufferRt_GenerateRenderMethodt_CompileContexttgetvalue(tnodeturitfilenametdefault_filterstbuffer_filterstimportstsource_encodingtgenerate_magic_commenttdisable_unicodetstrict_undefinedt enable_looptreserved_namestbuftprinter((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytcompiles$  RcBseZdZRS(c Csg||_||_||_||_||_||_||_||_| |_| |_ | |_ dS(N( RRRRRRRRRRR( tselfRRRRRRRRRRR((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt__init__As          (t__name__t __module__R!(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR@sRcBseZdZdZedZdZdZdZdZ dZ e ddZ d Zd Zd Zed Ze e d ZdZdZdZdZdZdZdZdZdZdZdZdZRS(s]A template visitor object which generates the full module source for a template. c Cs7||_d|_||_||_dg|_t|tjtj f|_ |j rd|j }|j }t |jjdk}t|jjdd}t|jjdd}d} d} |jr|j r|dg7}qn|j} |jj} d}| dk r| jj }| jjsE|dg7}nt| jjdd}|jjpt| jjd d|j_ndg}t}t}}|dkrd g}n gd g|D] } | ^q}|j| p||||||| dk r3x!| D]}t|||qWndS( Nis render_%sitbufferedtFalsetcacheds **pageargst render_bodyRR(Rtlast_source_linetcompilerRtNonetidentifier_stackR RtDefTagtBlockTagtin_deftfuncnametget_argument_expressionstlent filter_argstargstevalt attributestgettis_blockt is_anonymoustwrite_topleveltpagetagt body_decltkwargsRR%twrite_render_callableR( R RR)RtnameR3tfilteredR$R&tdefsR:ta((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR!^sP                      cCs |jdS(Ni(R+(R ((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt identifierssc segigdg}dj_dtffdY}|}x!jjD]}|j|qbWj_t}x#D]}|j |j }qWt j}||_ jj rjjrjjdjjnjjdjjdjjdjjdjjdtjjd tjjjd jjjjd jjjjd jjjjd jjjjrHd}x2jjD]$}||d7}jj|qWtj|dddddddd} nd} |jj} |jj | j|_|j jd| r|j j| j n|j_jjdg| jjD]}|j^qjj dt!rj"nt!r<j#j$dnt!rXj#n| jjS(sxTraverse a template structure for module-level directives and generate the start of module-level code. t FindTopLevelcsDeZfdZfdZfdZfdZRS(csj|dS(N(tappend(tsR(tinherit(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitInheritTagscs||j(RER(t namespaces(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitNamespaceTagscs|j_dS(N(R)R:(RER(R (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt visitPageTagscs|jrj|ndS(N(tismoduleRD(RER(t module_code(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt visitCodes (R"R#RGRIRJRM((RFRLRHR (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRCss# -*- encoding:%s -*-s(from mako import runtime, filters, cachesUNDEFINED = runtime.UNDEFINEDs__M_dict_builtin = dicts__M_locals_builtin = localss_magic_number = %rs_modified_time = %rs_enable_loop = %rs_template_filename = %rs_template_uri = %rs_source_encoding = %rts tsourcetlinenoitposRstemplate defined importsRs _exports = %rs iN(%R*R)R:tobjectRtnodestaccept_visitorRHtsettuniontdeclared_identifierst _IdentifierstdeclaredRRRt writelinet MAGIC_NUMBERttimeRRRRRt PythonCodetbrancht topleveldefstaddtupdateRBtvaluesR>twriteR1twrite_module_codetwrite_namespacest write_inherit( R tencodingRCtftnt module_identtmodule_identifiersRtimptimpcodetmain_identifiers((RFRLRHR s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR9sz  %                $    c Cs|jr2|j}|r2|jjd|q2n|jjd|dj|fdd|sm|sm|r|jjdn|jj|jj j |j |j s|j j rd|kr|jdj jd n|j r[t|j jd kst|j j d kr[|jjd djg|j j D]}d ||f^q7n|j|j d tx!|j jD]} | j|q~W|j|j ||||jjd|jjd|r|j|||||j d tndS(snwrite a top-level render callable. this could be the main render() method or that of a top-level def.s@runtime._decorate_toplevel(%s)s def %s(%s):t,s/__M_caller = context.caller_stack._push_frame()stry:scontext._push_buffer()s **pageargsitpageargsis!__M_locals = __M_dict_builtin(%s)s%s=%sttoplevels N(R.t decoratorRRZt writelinestjoinR+RDR)RBR^RR7targument_declaredR`R1tlocally_assignedtwrite_variable_declarestTrueRSRTtwrite_def_finishR*Rctwrite_cache_decorator( R RR>R3R$R?R&RrtxRi((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR=sB     "  .cCs5x.|D]&}|j||jj|jqWdS(sewrite module-level template code, i.e. that which is enclosed in <%! %> tags in the template.N(twrite_source_commentRtwrite_indented_blockttext(R RLRi((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRd#s  cCs(|jjddd|jdddS(s:write the module-level inheritance-determination callable.s%def _mako_inherit(template, context):s"_mako_generate_namespaces(context)s8return runtime._inherit_from(context, %s, _template_uri)tfileN(RRstparsed_attributesR*(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRf*s   c sjjddddddddjjdx|jD] }|jjdritj_ nj |t |j rDjjdgjj j|t_d tffd Y}|}x|j D]}|j|qWjjd d jjjdt_d }nd}d|jkrjjd|j|jjdd|fn^d|jkrjjd|j||jjddfnjjd|j|ft|jjddrjjd|jnjjdt|jjjdqBWt |snjjdnjjddS(s5write the module-level namespace-generating callable.s'def _mako_get_namespace(context, name):stry:s+return context.namespaces[(__name__, name)]sexcept KeyError:s"_mako_generate_namespaces(context)s'def _mako_generate_namespaces(context):timportsdef make_namespace():t NSDefVisitorcs/eZdZdZfdZRS(cSs|j|dS(N(tvisitDefOrBase(RER((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt visitDefTagMscSs|j|dS(N(R(RER((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt visitBlockTagPscsK|jr!tjd|jnj|dtj|jdS(Ns.Can't put anonymous blocks inside <%namespace>tnested(R8RtCompileExceptiontexception_kwargstwrite_inline_defR%RDR/(RER(texportRBR (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRSs  (R"R#RRR((RRBR (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRLs  s return [%s]Rosmake_namespace()R*Rsns = runtime.TemplateNamespace(%r, context._clean_inheritance_tokens(), templateuri=%s, callables=%s, calling_uri=_template_uri)tmodulesyns = runtime.ModuleNamespace(%r, context._clean_inheritance_tokens(), callables=%s, calling_uri=_template_uri, module=%s)shns = runtime.Namespace(%r, context._clean_inheritance_tokens(), callables=%s, calling_uri=_template_uri)t inheritableR%scontext['self'].%s = nss'context.namespaces[(__name__, %s)] = nss tpassN(RRsR*RZRbR5thas_keyRxR)thas_ns_importsR|R1RSRBR^R.RRRTRtR%RR>R6R4treprRc(R RHRRtvisRit callable_name((RRBR s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRe5sf    "         c CsTtg|jD]}|j|f^q }t}|j|j}|jg|jjD]}|j^q\}|j|j }|j|j }|j j rd|k}|j dnt}|dk r|j|}n|rt|j dtr|jjdt|j _xe|j jjD]N\}} | jjdr.|jjd|tjd| jdfq.q.Wn|r|jjdnx|D]}||kr5||} | jr| js|j| |q2|j| |dtq<| j r|j| |q<|j| |dtq||j jkrd|jjd ||fqt|j dtr|j j!r|jj"d ||fd |d d ||fdd|ddq<|jjd|||fq|j j!r"|jj"d d ||fdd|dq|jjd||fqW|jjddS(swrite variable declarations at the top of a function. the variable declarations are in the form of callable definitions for defs and/or name lookup within the function's context argument. the names declared are based on the names that are referenced in the function body, which don't otherwise have any explicit assignment operation. names that are assigned within the body are assumed to be locally-scoped variables and are not separately declared. for def callable definitions, if the def is a top-level callable then a 'stub' callable is generated which wraps the current Context into a closure. if the def is not top-level, it is fully rendered as a local closure. RRs_import_ns = {}Rs:_mako_get_namespace(context, %r)._populate(_import_ns, %r)s\s*,\s*s%loop = __M_loop = runtime.LoopStack()Rs%%s = _mako_get_namespace(context, %r)s"%s = _import_ns.get(%r, UNDEFINED)sif %s is UNDEFINED:stry:s%s = context[%r]sexcept KeyError:s&raise NameError("'%s' is not defined")s3%s = _import_ns.get(%r, context.get(%r, UNDEFINED))s%s = context.get(%r, UNDEFINED)s__M_writer = context.writer()N(#tdictR@R/RURVt undeclaredt closuredefsRbt differenceRutlocally_declaredR)RtdiscardR%R*t intersectiontgetattrRRZRxt has_importsRHt iteritemsR5RtretsplitR7R8twrite_def_declRtis_rootRRs( R RBRqtlimittct comp_identstto_writethas_looptidenttnstcomp((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRws+ (     (                    cCs<|j|jkr8|jjd|j|j|_ndS(s]write a source comment containing the line number of the corresponding template line.s# SOURCE LINE %dN(R(RPRRZ(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR|scCs|j}|j}|jdt}|j rtt|jjdksat|jjdkrt|jddn|jdd|j j d|dj |f|j j d|dj |f|j j ddS( s>write a locally-available callable referencing a top-level deftinclude_defaultsiscontext.locals_(__M_locals)Rs def %s(%s):Rosreturn render_%s(%s)N( R/R0R%R.R1RBRvRutinsertRRZRtR*(R RRBR/t namedeclstnameargs((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRs   # c Cs|j}|j}|r2|jjd|n|jjd|jdj|ft|jjdk}t |j j dd}t |j j dd}|jj dd |s|s|r|jj d n|j |d |}|j||jj|x|jD]} | j|qW|jj|j|||||jjd|r|j||j|t|d td tndS(s?write a locally-available def callable inside an enclosing def.s&@runtime._decorate_inline(context, %s)s def %s(%s):RoiR$R%R&s/__M_caller = context.caller_stack._push_frame()stry:scontext._push_buffer()RtinlineRqN(R0RrRRZR/RtR1R2R3R4R5R6RsR^RwR+RDRSRTtpopRyR*RzR%Rx( R RRBRRRrR?R$R&Ri((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR(s8          cCsM| rG| rG| rG|jjd|rG|jjddd qGn|sY|sY|rI|se|r{|jjddn|jjdd|r|jjdnd}|r|j|jj|t}n|jjd |r | r |j|jj |t}n|s|r/|jjd|qI|jjd|dnd S( sJwrite the end section of a rendering function, either outermost or inline. this takes into account if the rendering function was filtered, buffered, etc. and closes the corresponding try: block if any, and writes code to retrieve captured content, apply filters, send proper return value.s return ''sfinally:s!context.caller_stack._pop_frame()s__M_buf = context._pop_buffer()s6__M_buf, __M_writer = context._pop_buffer_and_writer()s__M_buf.getvalue()s return %ss__M_writer(%s)N( RRZRsR*tcreate_filter_callableR2R3R%R)R(R RR$R?R&t callstackRE((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRyPs<           c s;jjd||fjjdt|}i} jjdk rv| jfdjjjDn| jfdjDd| krt t | d| dsc3sA|]7}|jdr|dkr|dj|fVqdS(RRiN(RR(RR(tnode_or_pagetag(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pys sttimeouts def %s(%s):Rot=s%s=%siiRqRs`context.get('local').cache._ctx_get_or_create(%s, lambda:__M_%s(%s), context, %s__M_defname=%r)RNs%s=%s, sreturn sk__M_writer(context.get('local').cache._ctx_get_or_create(%s, lambda:__M_%s(%s), context, %s__M_defname=%r))s return ''N(RRZRR6RR)R:R*RatintR4RtRRwtundeclared_identifierstitemsRRR%Rs(R RR>R3R$RBRRqtcachekeyt cache_argsRAt pass_argstktvRE((RR s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRzsJ    #@  ,    ,c sfd}d|krk|rkjjrFjjjj|}njjrhjj|}qhqknx|D]}|dkrqrntjd|}|r|jdd\}}||} | |}n$|} ||}|dk st d||f}qrW|S(swrite a filter-applying expression based on the filters present in the given filter names, adjusting for the global 'default' filter aliases as needed.csPtjd|rd|Sjjr9tjj||Stjj||SdS(Ns decode\..+sfilters.(RtmatchR)RRtNON_UNICODE_ESCAPESR6tDEFAULT_ESCAPES(R>(R (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt locate_encodes  Ris (.+?)(\(.*\))iis%s(%s)N( R)R:R2R3RRRtgroupR*tAssertionError( R R3ttargett is_expressionRtetmRtfargsRhR{((R s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRs(        cCs|j|t|jsX|jjdk rFt|jjjjsXt|jjr|j |j jd|j t }|j jd|n|j jd|j dS(Ns%ss__M_writer(%s)(R|R1tescapesR)R:R*R2R3RRt escapes_codeR~RxRRZ(R RRE((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitExpressions csjrX|jjdjr |jjd|jjd|jjdq n|j|jjrjdkrt |j}n j }|jj|j }| st j d|Dr t j fd|Dr |jjdndS(Nsfinally:sloop = __M_loop._exit()tforcss*|] }t|tjtjfVqdS(N(R RtCommentt ControlLine(RR((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pys sc3s<|]2}t|tjrj|jp3|jVqdS(N(R RRt is_ternarytkeywordtisend(RR(R(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pys sR(RRRZR*thas_loop_contextR|R)RRtmangle_mako_loopR~t get_childrenRtall(R RR~tchildren((Rs=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitControlLines$        cCs.|j||jjdt|jdS(Ns__M_writer(%s)(R|RRZRtcontent(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt visitTexts cCst|jjdk}|r4|jjddnx|jD]}|j|q>W|r|jjddd|j|jjdtdndS(Nis#__M_writer = context._push_writer()stry:sfinally:s6__M_buf, __M_writer = context._pop_buffer_and_writer()s__M_writer(%s)s__M_buf.getvalue()( R1R2R3RRsRSRTRR%R*(R RR?Ri((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt visitTextTags"    cCs|js|j||jj|j|j rt|jjdkr|jj d|jj ddj g|j D]}t |^qzqndS(Nis0__M_locals_builtin_stored = __M_locals_builtin()s__M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in [%s] if __M_key in __M_locals_builtin_stored]))Ro( RKR|RR}R~R.R1RBRvRZRtRWR(R RR{((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRM4s  "  cCsh|j||jjd}|rI|jjd|jd|fn|jjd|jddS(NR3s5runtime._include_file(context, %s, _template_uri, %s)Rs1runtime._include_file(context, %s, _template_uri)(R|R5R6RRZR(R RR3((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitIncludeTagFs   cCsdS(N((R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRIRscCsdS(N((R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRUscCs|jr#|jjd|jnl|jdt}|dg7}|jjd|j|jjd|jdj|f|jjddS(Ns%s()Rs **pageargssOif 'parent' not in context._data or not hasattr(context._data['parent'], '%s'):scontext['self'].%s(%s)Ros (R8RRZR/R0R%Rt(R RR((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRXs     cCs|j|dS(N(t visitCallTag(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitCallNamespaceTagescsjjddgjj|dtj|dtjdjjdt ffdY}|}x|j D]}|j |qWjj |j j}jjddj|t}|r jjd d njjjx|j D]}|j q4Wjj j||ttd tjjdd djdjjd d j|jjdjg|jtddddS(Nsdef ccall(caller):tbodyRtcallert DefVisitorcs2eZdZdZfdZRS(cSs|j|dS(N(R(RER((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRxscSs|j|dS(N(R(RER((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR{scsXj|dt|js2j|jn|jjkrTj|j=ndS(NR(RR%R8RDR/R(RER(tbody_identifierstcallable_identifiersRR (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR~s  (R"R#RRR((RRRR (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRws  s def body(%s):Roscontext._push_buffer()stry:Rs return [%s]sccontext.caller_stack.nextcaller = runtime.Namespace('caller', context, callables=ccall(__M_caller))s__M_writer(%s)sfinally:s&context.caller_stack.nextcaller = None(RRZRBR^RxR%t add_declaredR+RDRRRSRTRR;R0RtRsRwRyR*R|Rt expression(R RRRRitbodyargsR$((RRRR s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRksL  %           N( R"R#t__doc__R!tpropertyRBR9R=RdRfReR%R*RwR|RRRxRyRzRRRRRRMRRIRRRR(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRYs4 2 ] 2  ]~   ) 7D #        RXcBseZdZddedZdZedZdZ dZ dZ dZ dZ d Zd Zd Zd Zd ZdZdZdZdZdZRS(sCtracks the status of identifier names as template code is rendered.cCs|dk rt|tjr<t|_tj|_qt|jj g|j j D]}|j ^q[j |j j |j|_|r|jj |j|_ntj|j|_nt|_tj|_||_t|_t|_ t|_t|_tj|_ ||_|dk rO|j|n|jjj|j }|rtjddj|ndS(Ns'Reserved words declared in template: %ss, (R*R Rt NamespaceTagRURYRt SetLikeDictR_RVRRbR>RRuRR)RvRRTRRRtNameConflictErrorRt(R R)RtparentRRt illegal_names((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR!s8  (           cKst|j|||S(sWcreate a new Identifiers for a new Node, with this Identifiers as the parent.(RXR)(R RR<((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR^scCst|jj|jjS(N(RUR_RVRRb(R ((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR@scCsvdt|jt|jt|jg|jjD]}|j^q7g|jjD]}|j^qY|jfS(NsrIdentifiers(declared=%r, locally_declared=%r, undeclared=%r, topleveldefs=%r, closuredefs=%r, argumentdeclared=%r)( tlistRYRRR_RbR>RRu(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt__repr__s   ""cCs|xN|jD]@}|dkr ||jj|jkr |jj|q q Wx$|jD]}|jj|q^WdS(spupdate the state of this Identifiers with the undeclared and declared identifiers of the given node.RN(RRYRVRRR`RW(R RR((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytcheck_declared s  cCs6|jj|||jkr2|jj|ndS(N(RYR`Rtremove(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRscCs|j|dS(N(R(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRscCs|j|dS(N(R(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR scCs8|js4|j||jj|j|_ndS(N(RKRRvRVRW(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRM#s   cCs7|j|kr3x!|jD]}|j|qWndS(N(RRSRT(R RRi((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRI)scCsl|j|j}|||j<|dk rh||k rh|jsI|jrhtjd|j|jndS(Ns<%%def or %%block named '%s' already exists in this template.(R6R/R*R7RRR(R t collectionRtexisting((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt_check_name_exists1s   cCs|jr,|j r,|j|j|n%||jk rQ|j|j|nxN|jD]@}|dkr^||jj|j kr^|j j |q^q^W||jkrx$|j D]}|j j |qWx!|jD]}|j|qWndS(NR(RR8RR_RRRRYRVRRR`RWRuRSRT(R RRRi((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR<s cCs||jk r|j rt|jtjrYtjd|j|jjf|jqt|jtj tj frtjd|jf|jqnxN|j D]@}|dkr||j j |jkr|jj|qqW|js|j|j||jj|jn%||jk rD|j|j|nx$|jD]}|jj|qQWx|jD]}|j|quWdS(Ns/Named block '%s' not allowed inside of def '%s's3Named block '%s' not allowed inside of <%%call> tagR(RR8R RR,RRR>RtCallTagtCallNamespaceTagRRYRVRRR`RR_R/RRWRuRSRT(R RRRi((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyROs0 "   cCsUxN|jD]@}|dkr ||jj|jkr |jj|q q WdS(NR(RRYRVRRR`(R RR((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRls cCs|j|dS(N(R(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRrscCs8x$|jD]}|jj|q W|j|dS(N(RWRuR`R(R RR((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRJuscCs|j|dS(N(R(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRzscCs||jkrxN|jD]@}|dkr||jj|jkr|jj|qqWx$|jD]}|jj|qmWxr|j D]}|j |qWnQxN|jD]@}|dkr||jj|jkr|jj|qqWdS(NR( RRRYRVRRR`RWRuRSRT(R RRRi((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR}s  N(R"R#RR*R%R!R^RR@RRRRRRMRIRRRRRRJRR(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRXs&@            si^for\s+((?:\(?)\s*[A-Za-z_][A-Za-z_0-9]*(?:\s*,\s*(?:[A-Za-z_][A-Za-z0-9_]*),??)*\s*(?:\)?))\s+in\s+(.*):cCst}|j||jrt|jd_tj|j}|rz|j d|j ddd|j d}qt d|jn |j}|S(sconverts a for loop into a context manager wrapped around a for loop when access to the `loop` variable has been detected in the for loop body isloop = __M_loop._enter(%s)istry:sfor %s in loop:isCouldn't apply loop context: %s( t LoopVariableRTtdetectedRxRSRt _FOR_LOOPRR~RsRt SyntaxError(RRt loop_variableRR~((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRs    RcBs;eZdZdZdZdZdZdZRS(sQA node visitor which looks for the name 'loop' within undeclared identifiers.cCs t|_dS(N(R%R(R ((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR!scCsFd|jkrt|_n$x!|jD]}|j|q+WdS(NR(RRxRRRT(R RRi((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt_loop_reference_detecteds cCs|j|dS(N(R(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRscCs|j|dS(N(R(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRMscCs|j|dS(N(R(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRs(R"R#RR!RRRMR(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRs     (RR\Rt mako.pygenRtmakoRRRRRR[RUtRESERVED_NAMESR*RxR%RRRRRRXRRR(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyts4  ( ^