%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyc

�
�ǚPc@sdZddlZddlZddlmZddlmZmZmZm	Z	m
Z
dZedddg�Z
eeeeeeeeefd	�
Zd
efd��YZdefd
��YZdefd��YZejd�Zd�Zdefd��YZdS(sVprovides functionality for rendering a parsetree constructing into module
source code.i����N(t
PythonPrinter(tutiltastt	parsetreetfilterst
exceptionsitcontexttloopt	UNDEFINEDcCs�tjr+t|t�r+|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_undefinedtenable_looptreserved_namestbuftprinter((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytcompiles$RcBseZd�ZRS(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@sRcBseZdZd�Zed��Zd�Zd�Zd�Zd�Z	d�Z
edd�Z
d	�Zd
�Zd�Zed�Zeed
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s]A template visitor object which generates the
       full module source for a template.

    c	Cs7||_d|_||_||_dg|_t|tjtj	f�|_
|j
r�d|j}|j�}t
|jj�dk}t|jjdd��}t|jjdd��}d}	d}
|jr�|jr�|dg7}q�n�|j�}	|jj}
d}|
dk	r�|
jj�}|
jjsE|dg7}nt|
jjdd��}|jjp�t|
jjd	d��|j_ndg}t}t}}|dkr�d
g}n gd
g|D]}|^q�}|j|
p�||||||�|	dk	r3x!|	D]}t|||�qWndS(Ni����s	render_%sitbufferedtFalsetcacheds
**pageargstrender_bodyRR(Rtlast_source_linetcompilerRtNonetidentifier_stackR
RtDefTagtBlockTagtin_deftfuncnametget_argument_expressionstlentfilter_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.pytidentifiers�scseg�i�g�dg}d�j_dtf����fd��Y}|�}x!�jjD]}|j|�qbW��j_t�}x#�D]}|j	|j
��}q�Wt�j�}||_�jj
r�jjr�jjd�jj�n�jjd��jjd��jjd��jjd��jjdt��jjd	tj���jjd
�jj��jjd�jj��jjd�jj��jjd
�jj��jjrHd}x2�jjD]$}||d7}�jj|�q�Wtj|dddddddd�}	nd}	|j�j�}
|jj	|
j�|_|jjd�|	r�|jj|	j
�n|�j_�jjdg|
jj�D]}|j^q���jj d�t!��r�j"��nt!��r<�j#���j$�d�nt!��rX�j#��n|
jj�S(sxTraverse a template structure for module-level directives and
        generate the start of module-level code.

        tFindTopLevelcsDeZ�fd�Z�fd�Z�fd�Z�fd�ZRS(cs�j|�dS(N(tappend(tsR(tinherit(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitInheritTag�scs|�|j<dS(N(R>(RER(t
namespaces(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitNamespaceTag�scs|�j_dS(N(R)R:(RER(R (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitPageTag�scs|jr�j|�ndS(N(tismoduleRD(RER(tmodule_code(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt	visitCode�s	(R"R#RGRIRJRM((RFRLRHR (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRC�ss# -*- 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

i����N(%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.pyR9�sz	%		
				$
c
Cs�|jr2|j}|r2|jjd|�q2n|jjd|dj|�fdd�|sm|sm|r�|jjd�n|jj|jj	j
|j��|js�|jjr�d|kr�|jdj
jd	�n|jr[t|j	j�d
kst|j	j
�d
kr[|jjddjg|j	j
D]}d||f^q7��n|j|j	d
t�x!|jjD]}	|	j|�q~W|j|j|||�|jjd�|jjd�|r�|j|||||j	d
t�ndS(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)sdef %s(%s):t,s/__M_caller = context.caller_stack._push_frame()stry:scontext._push_buffer()s
**pageargsi����tpageargsis!__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|j�qWdS(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|jdd�dS(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	s��jjdddddddd��jjd�x|j�D]	}|jjd�rit�j_	n�j
|�t|j�rD�jjd�g��jj
j|��t�_d	tf���fd
��Y}|�}x|jD]}|j|�q�W�jjddj����jjd�t�_d
}nd}d|jkr��jjd|j|jjdd�|f�n^d|jkr��jjd|j||jjdd�f�n�jjd|j|f�t|jjdd��r�jjd|j�n�jjdt|j���jjd�qBWt|�sn�jjd�n�jjd�dS(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/eZd�Zd�Z���fd�ZRS(cSs|j|�dS(N(tvisitDefOrBase(RER((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitDefTagMscSs|j|�dS(N(R�(RER((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt
visitBlockTagPscsK|jr!tjd|j��n�j|�dt��j|j�dS(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.pyR�Ss	(R"R#R�R�R�((R�RBR (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�Ls		sreturn [%s]Rosmake_namespace()R*Rs�ns = 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)tinheritableR%scontext['self'].%s = nss'context.namespaces[(__name__, %s)] = nss
tpassN(RRsR*RZRbR5thas_keyRxR)thas_ns_importsR|R1RSRBR^R.RRRTRtR%R�R>R6R4treprRc(R RHRR�tvisRit
callable_name((R�RBR s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRe5sf	

	"							cCsTtg|jD]}|j|f^q
�}t�}|j|j�}|jg|jj�D]}|j^q\�}|j|j	�}|j|j
�}|jjr�d|k}|j
d�nt}|dk	r�|j|�}n|r�t|jdt�r�|jjd�t|j_xe|jjj�D]N\}}	|	jjd�r.|jjd|tjd|	jd�f�q.q.Wn|r�|jjd�nx�|D]�}||kr5||}
|
jr�|
js�|j|
|�q2|j|
|dt�q<|
j �r|j|
|�q<|j|
|dt�q�||jjkrd|jjd	||f�q�t|jdt�r�|jj!r�|jj"d
||fd|dd
||fdd|dd�q<|jjd|||f�q�|jj!r"|jj"dd
||fdd|d�q�|jjd||f�q�W|jjd�dS(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.

        RR�s_import_ns = {}R�s:_mako_get_namespace(context, %r)._populate(_import_ns, %r)s\s*,\s*s%loop = __M_loop = runtime.LoopStack()R�s%%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
undeclaredtclosuredefsRbt
differenceRutlocally_declaredR)RtdiscardR%R*tintersectiontgetattrRRZRxthas_importsRHt	iteritemsR5R�tretsplitR7R8twrite_def_declR�tis_rootRRs(R RBRqtlimittctcomp_identstto_writethas_looptidenttnstcomp((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRw�s�+	(	(	


				


		

	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|jj�dksat|jj�dkrt|jdd�n|jdd�|j	j
d|dj|�f�|j	j
d|dj|�f�|j	j
d�dS(	s>write a locally-available callable referencing a top-level deftinclude_defaultsiscontext.locals_(__M_locals)Rsdef %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.pyR�s	
#	c
Cs�|j�}|j}|r2|jjd|�n|jjd|jdj|�f�t|jj�dk}t	|j
jdd��}t	|j
jdd��}|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
t�ndS(s?write a locally-available def callable inside an enclosing def.s&@runtime._decorate_inline(context, %s)sdef %s(%s):RoiR$R%R&s/__M_caller = context.caller_stack._push_frame()stry:scontext._push_buffer()R�tinlineRqN(R0RrRRZR/RtR1R2R3R4R5R6RsR^RwR+RDRSRTtpopRyR*RzR%Rx(
R RRBR�R�RrR?R$R&Ri((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�(s8					


c
CsM|rG|rG|rG|jjd�|rG|jjddd	�qGn|sY|sY|rI|se|r{|jjdd�n|jjdd�|r�|jjd�nd}|r�|j|jj|t�}n|jjd	�|r|r|j|jj	|t�}n|s|r/|jjd|�qI|jjd|d�nd	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<
	
	
	
	cs;�jjd||f��jjdt|��}i}	�jjdk	rv|	j�fd��jjjD��n|	j�fd��jD��d|	kr�t	t
|	d��|	d<n�jjd|dj|�f�g|D]6}
d|
krd	|
jd�d
fdp|
^q�}�j
|d|d
�j��|r�d||dj|�djg|	j�D]\}}
d||
f^qr�|f}�j�jj|t�}�jjd|d�nd�jjd||dj|�djg|	j�D]\}}
d||
f^q�|fdd�dS(slwrite a post-function decorator to replace a rendering
            callable with a cached version of itself.s__M_%s = %st	cache_keyc3sG|]=}|jd�r|dkr|d�jjj|fVqdS(tcache_R�iN(t
startswithR)R:R�(t.0tpa(R (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pys	<genexpr>�sc3sA|]7}|jd�r|dkr|d�j|fVqdS(R�R�iN(R�R�(R�R�(tnode_or_pagetag(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pys	<genexpr>�sttimeoutsdef %s(%s):Rot=s%s=%siiRqR�s`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(RRZR�R6R�R)R:R*RatintR4RtR�Rwtundeclared_identifierstitemsR�RR%Rs(R R�R>R3R$RBR�Rqtcachekeyt
cache_argsRAt	pass_argstktvRE((R�R s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRz�sJ#@
	,
			,cs�fd�}d|krk|rk�jjrF�jjjj|}n�jjrh�jj|}qhqknx�|D]�}|dkr�qrntjd|�}|r�|jdd�\}}||�}	|	|}n$|}
||�}|dk	s�t	�d||f}qrW|S(s�write 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|S�jjr9tjj||�Stjj||�SdS(Ns
decode\..+sfilters.(R�tmatchR)RRtNON_UNICODE_ESCAPESR6tDEFAULT_ESCAPES(R>(R (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt
locate_encode�s
Ris
(.+?)(\(.*\))iis%s(%s)N(
R)R:R2R3RR�R�tgroupR*tAssertionError(R R3ttargett
is_expressionR�tetmR�tfargsRhR{((R s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR��s(

cCs�|j|�t|j�sX|jjdk	rFt|jjjj�sXt|jj�r�|j	|j
jd|jt�}|j
jd|�n|j
jd|j�dS(Ns%ss__M_writer(%s)(R|R1tescapesR)R:R*R2R3RR�tescapes_codeR~RxRRZ(R RRE((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitExpression�s
cs�jrX|jjd��jr|jjd�|jjd�|jjd�qn�|j��|jjr��jdkr�t	�|j�}n	�j
}|jj|��j�}|s�tj
d�|D��rtj
�fd�|D��r|jjd�ndS(Nsfinally:sloop = __M_loop._exit()tforcss*|] }t|tjtjf�VqdS(N(R
RtCommenttControlLine(R�R�((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pys	<genexpr>sc3s<|]2}t|tj�r�j|j�p3|jVqdS(N(R
RR�t
is_ternarytkeywordtisend(R�R�(R(s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pys	<genexpr>sR�(R�RRZR*thas_loop_contextR|R)RR�tmangle_mako_loopR~tget_childrenRtall(R RR~tchildren((Rs=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitControlLine�s$		
	

cCs.|j|�|jjdt|j��dS(Ns__M_writer(%s)(R|RRZR�tcontent(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt	visitTexts
cCs�t|jj�dk}|r4|jjdd�nx|jD]}|j|�q>W|r�|jjddd|j|jjdt�d�ndS(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()(
R1R2R3RRsRSRTR�R%R*(R RR?Ri((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitTextTags"	
		cCs�|js�|j|�|jj|j�|jr�t|jj�dkr�|jj	d�|jj	ddj
g|j�D]}t|�^qz��q�ndS(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|f�n|jjd|jd�dS(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.pyR�UscCs�|jr#|jjd|j�nl|jdt�}|dg7}|jjd|j�|jjd|jdj|�f�|jjd�dS(Ns%s()R�s
**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.pyR�Xs	
	cCs|j|�dS(N(tvisitCallTag(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytvisitCallNamespaceTagescs��jjd�dg��jj|dt���j|dt���jd��jj��dt	f����fd��Y}|�}x|j
D]}|j|�q�W�jj�|j
j�}�jjddj|��t}|r
�jjd	d
�n�j���jj��x|j
D]}|j��q4W�jj��j||ttdt��jjdddj��d��jjd
d
��j|��jjd�jg|jt�ddd�dS(Nsdef ccall(caller):tbodyR�tcallert
DefVisitorcs2eZd�Zd�Z����fd�ZRS(cSs|j|�dS(N(R�(RER((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�xscSs|j|�dS(N(R�(RER((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�{scsX�j|�dt�|js2�j|j�n|j�jkrT�j|j=ndS(NR�(R�R%R8RDR/R�(RER(tbody_identifierstcallable_identifiersR�R (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�~s
	(R"R#R�R�R�((R�R�R�R (s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�ws		s
def body(%s):Roscontext._push_buffer()stry:R�sreturn [%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+RDRRRSRTR�R;R0RtRsRwRyR*R|R�t
expression(R RR�R�RitbodyargsR$((R�R�R�R s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�ksL	
%	
	


		
		N( R"R#t__doc__R!tpropertyRBR9R=RdRfReR%R*RwR|R�R�RxRyRzR�R�R�R�R�RMR�RIR�R�R�R�(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRYs4	2	]	2			]~			)7D	#									
	RXcBs�eZdZdded�Zd�Zed��Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�ZRS(sCtracks the status of identifier names as template code is rendered.cCs�|dk	r�t|tj�r<t�|_tj�|_q�t|j�j	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
�}|r�tjddj|���ndS(Ns'Reserved words declared in template: %ss, (R*R
RtNamespaceTagRURYRtSetLikeDictR_RVR�RbR>R�RuR�R)RvRRTRR�RtNameConflictErrorRt(R R)RtparentR�R�t
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|j�j��S(N(RUR_RVR�Rb(R ((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR@�scCsvdt|j�t|j�t|j�g|jj�D]}|j^q7g|jj�D]}|j^qY|jfS(NsrIdentifiers(declared=%r, locally_declared=%r, undeclared=%r, topleveldefs=%r, closuredefs=%r, argumentdeclared=%r)(	tlistRYR�R�R_RbR>R�Ru(R R�((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt__repr__s""cCs|xN|j�D]@}|dkr
||jj|j�kr
|jj|�q
q
Wx$|j�D]}|jj|�q^WdS(spupdate the state of this Identifiers with the undeclared
            and declared identifiers of the given node.RN(R�RYRVR�R�R`RW(R RR�((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pytcheck_declared
scCs6|jj|�||jkr2|jj|�ndS(N(RYR`R�tremove(R R�((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�scCs|j|�dS(N(R�(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�scCs|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(RKR�RvRVRW(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|j��ndS(Ns<%%def or %%block named '%s' already exists in this template.(R6R/R*R7RR�R�(R t
collectionRtexisting((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt_check_name_exists1s
cCs|j�r,|jr,|j|j|�n%||jk	rQ|j|j|�nxN|j�D]@}|dkr^||jj|j	�kr^|j
j|�q^q^W||jkr�x$|j�D]}|j
j|�q�Wx!|jD]}|j|�q�WndS(NR(R�R8R�R_RR�R�RYRVR�R�R`RWRuRSRT(R RR�Ri((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�<scCs�||jk	r�|jr�t|jtj�rYtjd|j|jjf|j��q�t|jtj	tj
f�r�tjd|jf|j��q�nxN|j�D]@}|dkr�||jj
|j�kr�|jj|�q�q�W|js|j|j|�|jj|j�n%||jk	rD|j|j|�nx$|j�D]}|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,RR�R>R�tCallTagtCallNamespaceTagR�RYRVR�R�R`R�R_R/R�RWRuRSRT(R RR�Ri((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�Os0
"		cCsUxN|j�D]@}|dkr
||jj|j�kr
|jj|�q
q
WdS(NR(R�RYRVR�R�R`(R RR�((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�lscCs|j|�dS(N(R�(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�rscCs8x$|j�D]}|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.pyR�zscCs||jkr�xN|j�D]@}|dkr||jj|j�kr|jj|�qqWx$|j�D]}|jj|�qmWxr|j	D]}|j
|�q�WnQxN|j�D]@}|dkr�||jj|j�kr�|jj|�q�q�WdS(NR(RR�RYRVR�R�R`RWRuRSRT(R RR�Ri((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR�}sN(R"R#R�R*R%R!R^R�R@R�R�R�R�R�RMRIR�R�R�R�R�RJR�R�(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRX�s&@															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+(.*):cCs�t�}|j|�|jr�t|jd_tj|j�}|rz|j	d|j
d�d�d|j
d�}q�td|j��n	|j}|S(s�converts 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
    i����sloop = __M_loop._enter(%s)istry:sfor %s in loop:isCouldn't apply loop context: %s(tLoopVariableRTtdetectedRxRSR�t	_FOR_LOOPR�R~RsR�tSyntaxError(RRt
loop_variableR�R~((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR��s	
		R�cBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(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|j�krt|_n$x!|j�D]}|j|�q+WdS(NR(R�RxR�R�RT(R RRi((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt_loop_reference_detected�scCs|j|�dS(N(R�(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR��scCs|j|�dS(N(R�(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyRM�scCs|j|�dS(N(R�(R R((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR��s(R"R#R�R!R�R�RMR�(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyR��s				(R�R\R�t
mako.pygenRtmakoRRRRRR[RUtRESERVED_NAMESR*RxR%RRRRRRXR�R�R�(((s=/opt/alt/python27/lib/python2.7/site-packages/mako/codegen.pyt<module>s4(���^�		

Zerion Mini Shell 1.0