+
    WBil                     r   R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt  ! R R4      t ! R R]	4      t
 ! R	 R
4      t]! 4       tRt ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R]4      t ! R R]4      tR tR tR tR tR tR tR tR&R ltR'R  ltR! tR" tR# tR(R$ lt R% t!R# ))zdprovides runtime services for templates, including Context,
Namespace, and various helper functions.N)compat)
exceptions)utilc                      a  ] tR t^t o RtR tR t]R 4       t]R 4       t	R t
R tR tR	 tR
 tR tR tR tRR ltR tR tR tR tR tRtV tR# )ContextzProvides runtime namespace, output buffer, and various
callstacks for templates.

See :ref:`runtime_toplevel` for detail on the usage of
:class:`.Context`.

c                   V.V n         W n        VP                  4       V n        R V n        R V n        / V n        \        P                  ! \        V 4      V P                  R&   \        4       ;V n        V P                  R&   R # )Ncapturecaller)_buffer_stack_datacopy_kwargs_with_template_outputting_as_unicode
namespaces	functoolspartialr   CallerStackcaller_stack)selfbufferdatas   &&,1/usr/lib/python3.14/site-packages/mako/runtime.py__init__Context.__init__   sl    $X
yy{"&*# !* 1 1'4 @

9 4?=@DJJx0    c                    Wn         VP                  P                  V P                  4      pV'       d-   \        P
                  ! R RP                  V4      ,          4      hR# )z%Reserved words passed to render(): %sz, N)r   reserved_namesintersectionr   r   NameConflictErrorjoin)r   tillegal_namess   && r   _set_with_templateContext._set_with_template.   sQ    ((55djjA..7))M*+  r   c                .    V P                   P                  # )zMReturn the :class:`.TemplateLookup` associated
with this :class:`.Context`.

)r   lookupr   s   &r   r&   Context.lookup7   s     "")))r   c                6    V P                   P                  4       # )a  Return the dictionary of top level keyword arguments associated
with this :class:`.Context`.

This dictionary only includes the top-level arguments passed to
:meth:`.Template.render`.  It does not include names produced within
the template execution such as local variable names or special names
such as ``self``, ``next``, etc.

The purpose of this dictionary is primarily for the case that
a :class:`.Template` accepts arguments via its ``<%page>`` tag,
which are normally expected to be passed via :meth:`.Template.render`,
except the template is being called in an inheritance context,
using the ``body()`` method.   :attr:`.Context.kwargs` can then be
used to propagate these arguments to the inheriting template::

    ${next.body(**context.kwargs)}

)r   r   r'   s   &r   kwargsContext.kwargs?   s    ( ||  ""r   c                <    V P                   P                  V4       R# )zIPush a ``caller`` callable onto the callstack for
this :class:`.Context`.N)r   append)r   r	   s   &&r   push_callerContext.push_callerU   s     	  (r   c                     V P                   R R# )zHPop a ``caller`` callable onto the callstack for this
:class:`.Context`.N)r   r'   s   &r   
pop_callerContext.pop_caller[   s     b!r   c                H    \        V P                  P                  4       4      # )zAReturn a list of all names established in this :class:`.Context`.)listr   keysr'   s   &r   r6   Context.keysa   s     DJJOO%&&r   c                v    WP                   9   d   V P                   V,          # \        P                  V,          # N)r   builtins__dict__r   keys   &&r   __getitem__Context.__getitem__f   s+    **::c?"$$S))r   c                z    \         P                  ! 4       pV P                  P                  V4       VP                  # )zMpush a capturing buffer onto this Context and return
the new writer function.)r   FastEncodingBufferr
   r-   writer   bufs   & r   _push_writerContext._push_writerl   s0     %%'!!#&yyr   c                r    V P                   P                  4       pWP                   R,          P                  3# )zepop the most recent capturing buffer from this Context
and return the current writer after the pop.

r1   )r
   poprB   rC   s   & r   _pop_buffer_and_writerContext._pop_buffer_and_writert   s2       $$&&&r*0000r   c                &    V P                  4        R# )z*push a capturing buffer onto this Context.N)rE   r'   s   &r   _push_bufferContext._push_buffer}   s     	r   c                6    V P                   P                  4       # )z7pop the most recent capturing buffer from this Context.)r
   rH   r'   s   &r   _pop_bufferContext._pop_buffer   s     !!%%''r   Nc                t    V P                   P                  V\        P                  P                  W4      4      # )z+Return a value from this :class:`.Context`.)r   getr:   r;   )r   r=   defaults   &&&r   rR   Context.get   s*     zz~~c8#4#4#8#8#FGGr   c                J    V P                   R,          P                  V4       R# )zKWrite a string to this :class:`.Context` object's
underlying output buffer.Nr1   r
   rB   )r   strings   &&r   rB   Context.write   s     	2$$V,r   c                <    V P                   R,          P                  # )z#Return the current writer function.r1   rV   r'   s   &r   writerContext.writer   s     !!"%+++r   c                B   \         P                  \         4      pV P                  Vn        V P                  P	                  4       Vn        V P
                  Vn        V P                  Vn        V P                  Vn        V P                  Vn        V P                  Vn	        V# r9   )
r   __new__r
   r   r   r   r   r   r   r   )r   cs   & r   _copyContext._copy   ss    OOG$,,**//#LL	..#'#>#> **r   c                p    V'       g   V # V P                  4       pVP                  P                  V4       V# )zCreate a new :class:`.Context` with a copy of this
:class:`.Context`'s current state,
updated with the given dictionary.

The :attr:`.Context.kwargs` collection remains
unaffected.


)r_   r   update)r   dr^   s   && r   _localsContext._locals   s,     KJJL	qr   c                    V P                  4       pVP                  pVP                  RR4       VP                  RR4       VP                  RR4       V# )z^create a new copy of this :class:`.Context`. with
tokens related to inheritance state removed.r   Nparentnext)r_   r   rH   )r   r^   xs   &  r   _clean_inheritance_tokens!Context._clean_inheritance_tokens   sG     JJLGG	fd	h	fdr   )r
   r   r   r   r   r   r   r9   )__name__
__module____qualname____firstlineno____doc__r   r#   propertyr&   r*   r.   r2   r6   r>   rE   rI   rL   rO   rR   rB   rZ   r_   rd   rj   __static_attributes____classdictcell____classdict__s   @r   r   r      s     A" * * # #*)"'
*1
(
H
-,
	"	 	r   r   c                   J   a  ] tR t^t o R tR tR tR tR tR t	R t
RtV tR	# )
r   c                    R V n         R # r9   
nextcallerr'   s   &r   r   CallerStack.__init__   s	    r   c                "    V P                  4       # r9   __bool__r'   s   &r   __nonzero__CallerStack.__nonzero__       }}r   c                p    \        V 4      ;'       d#    V P                  4       ;'       d    R ;'       g    R# )TF)len_get_callerr'   s   &r   r}   CallerStack.__bool__   s-    4y88T--/88DAAEAr   c                    V R,          #    r1    r'   s   &r   r   CallerStack._get_caller   s     Bxr   c                6    \        V P                  4       V4      # r9   )getattrr   r<   s   &&r   __getattr__CallerStack.__getattr__   s    t'')3//r   c                b    V P                   ;'       g    R pV P                  V4       R V n         V# r9   )ry   r-   )r   frames   & r   _push_frameCallerStack._push_frame   s+    ''4Er   c                0    V P                  4       V n        R # r9   )rH   ry   r'   s   &r   
_pop_frameCallerStack._pop_frame   s    ((*r   rx   N)rl   rm   rn   ro   r   r~   r}   r   r   r   r   rr   rs   rt   s   @r   r   r      s.     B
0% %r   r   c                   6   a  ] tR t^t o RtR tR tR tRtV t	R# )	UndefinedzRepresents an undefined value in a template.

All template modules have a constant value
``UNDEFINED`` present which is an instance of this
object.

c                    \        R 4      h)r   )	NameErrorr'   s   &r   __str__Undefined.__str__   s    $$r   c                "    V P                  4       # r9   r|   r'   s   &r   r~   Undefined.__nonzero__   r   r   c                    R # Fr   r'   s   &r   r}   Undefined.__bool__   s    r   r   N)
rl   rm   rn   ro   rp   r   r~   r}   rr   rs   rt   s   @r   r   r      s     % r   r    c                   ^   a  ] tR t^t o RtR tR tR t]R 4       t	R t
R tR tR	 tR
tV tR# )	LoopStackza stack for LoopContexts that implements the context manager protocol
to automatically pop off the top of the stack on context exit
c                    . V n         R # r9   stackr'   s   &r   r   LoopStack.__init__   s	    
r   c                <    V P                  V4       V P                  # r9   )_push_topr   iterables   &&r   _enterLoopStack._enter   s    

8yyr   c                :    V P                  4        V P                  # r9   )_popr   r'   s   &r   _exitLoopStack._exit   s    		yyr   c                P    V P                   '       d   V P                   R,          # V # r   r   r'   s   &r   r   LoopStack._top  s    :::::b>!Kr   c                6    V P                   P                  4       # r9   )r   rH   r'   s   &r   r   LoopStack._pop  s    zz~~r   c                    \        V4      pV P                  '       d   V P                  R,          Vn        V P                  P                  V4      # r   )LoopContextr   rg   r-   )r   r   news   && r   r   LoopStack._push  s9    (#:::BCJzz  %%r   c                .    \         P                  ! R 4      h)zNo loop context is established)r   RuntimeExceptionr<   s   &&r   r   LoopStack.__getattr__  s    ))*JKKr   c                ,    \        V P                  4      # r9   )iterr   r'   s   &r   __iter__LoopStack.__iter__  s    DIIr   r   N)rl   rm   rn   ro   rp   r   r   r   rq   r   r   r   r   r   rr   rs   rt   s   @r   r   r      sG        &L r   r   c                      a  ] tR tRt o RtR tR t]P                  R 4       t	]
R 4       t]
R 4       t]
R 4       t]
R	 4       t]
R
 4       tR tRtV tR# )r   i  an  A magic loop variable.
Automatically accessible in any ``% for`` block.

See the section :ref:`loop_context` for usage
notes.

:attr:`parent` -> :class:`.LoopContext` or ``None``
    The parent loop, if one exists.
:attr:`index` -> `int`
    The 0-based iteration count.
:attr:`reverse_index` -> `int`
    The number of iterations remaining.
:attr:`first` -> `bool`
    ``True`` on the first iteration, ``False`` otherwise.
:attr:`last` -> `bool`
    ``True`` on the last iteration, ``False`` otherwise.
:attr:`even` -> `bool`
    ``True`` when ``index`` is even.
:attr:`odd` -> `bool`
    ``True`` when ``index`` is odd.
c                .    Wn         ^ V n        RV n        R# )    N	_iterableindexrg   r   s   &&r   r   LoopContext.__init__3  s    !
r   c              #  n   "   V P                    F   pVx  V ;P                  ^,          un        K"  	  R# 5i)r   N)r   r   )r   is   & r   r   LoopContext.__iter__8  s%     AGJJ!OJ  s   35c                ,    \        V P                  4      # r9   )r   r   r'   s   &r   __len__LoopContext.__len__=  s    4>>""r   c                H    \        V 4      V P                  ,
          ^,
          # r   )r   r   r'   s   &r   reverse_indexLoopContext.reverse_indexA  s    4y4::%))r   c                     V P                   ^ 8H  # )r   )r   r'   s   &r   firstLoopContext.firstE  s    zzQr   c                @    V P                   \        V 4      ^,
          8H  # r   )r   r   r'   s   &r   lastLoopContext.lastI  s    zzSY]**r   c                $    V P                   '       * # r9   )oddr'   s   &r   evenLoopContext.evenM  s    88|r   c                :    \        V P                  ^,          4      # )   )boolr   r'   s   &r   r   LoopContext.oddQ  s    DJJN##r   c                l    V'       g   \        R4      hWP                  \        V4      ,          ,          # )z,Cycle through values as the loop progresses.z(You must provide values to cycle through)
ValueErrorr   r   )r   valuess   &*r   cycleLoopContext.cycleU  s'    GHHjj3v;.//r   r   N)rl   rm   rn   ro   rp   r   r   r   memoized_instancemethodr   rq   r   r   r   r   r   r   rr   rs   rt   s   @r   r   r     s     ,

 
!!# "# * *   + +   $ $0 0r   r   c                   ,   a  ] tR tRt o R tR tRtV tR# )_NSAttri\  c                    Wn         R # r9   )_NSAttr__parent)r   rg   s   &&r   r   _NSAttr.__init__]  s    r   c                    V P                   pV'       dA   \        VP                  V4      '       d   \        VP                  V4      # VP                  pKH  \        V4      hr9   )r   hasattrmoduler   inheritsAttributeError)r   r=   nss   && r   r   _NSAttr.__getattr__`  sD    ]]ryy#&&ryy#..[[S!!r   )__parentN)rl   rm   rn   ro   r   r   rr   rs   rt   s   @r   r   r   \  s     " "r   r   c                      a  ] tR tRt o RtRR ltRtRt Rt Rt	 Rt
 Rt Rt]P                  R 4       tR tR tR t]R	 4       tR
 tR tR tR tRtV tR# )	Namespaceij  ak  Provides access to collections of rendering methods, which
can be local, from other templates, or from imported modules.

To access a particular rendering method referenced by a
:class:`.Namespace`, use plain attribute access:

.. sourcecode:: mako

  ${some_namespace.foo(x, y, z)}

:class:`.Namespace` also contains several built-in attributes
described here.

Nc                    Wn         W n        W@n        Ve$   V Uu/ uF  qwP                  VbK  	  upV n        R # R # u upi r9   )namecontextr   rl   	callables)r   r   r   r   r   populate_selfcalling_urir^   s   &&&&&&& r   r   Namespace.__init__{  s=     	  5>?Yjj!mY?DN !?s   <c                    \        V 4      # )zAccess module level attributes by name.

This accessor allows templates to supply "scalar"
attributes which are particularly handy in inheritance
relationships.

.. seealso::

    :ref:`inheritance_attr`

    :ref:`namespace_attr_for_includes`

)r   r'   s   &r   attrNamespace.attr  s     t}r   c                   W3pW P                   P                  9   d   V P                   P                  V,          # \        VV P                   P                  4       VV P                  R7      pW0P                   P                  V&   V# )a  Return a :class:`.Namespace` corresponding to the given ``uri``.

If the given ``uri`` is a relative URI (i.e. it does not
contain a leading slash ``/``), the ``uri`` is adjusted to
be relative to the ``uri`` of the namespace itself. This
method is therefore mostly useful off of the built-in
``local`` namespace, described in :ref:`namespace_local`.

In
most cases, a template wouldn't need this function, and
should instead use the ``<%namespace>`` tag to load
namespaces. However, since all ``<%namespace>`` tags are
evaluated before the body of a template ever runs,
this method can be used to locate namespaces using
expressions that were generated within the body code of
the template, or to conditionally use a particular
namespace.

)templateurir   )r   r   TemplateNamespacer_   _templateuri)r   urir=   r   s   &&  r   get_namespaceNamespace.get_namespace  sr    ( k,,)))<<**3//LL ))	
 (*$	r   c                B    \        V P                  WP                  4      # )zReturn a :class:`.Template` from the given ``uri``.

The ``uri`` resolution is relative to the ``uri`` of this
:class:`.Namespace` object's :class:`.Template`.

)_lookup_templater   r  )r   r  s   &&r   get_templateNamespace.get_template  s      c3D3DEEr   c                <    V P                   P                  ! V3/ VB # )aX  Return a value from the :class:`.Cache` referenced by this
:class:`.Namespace` object's :class:`.Template`.

The advantage to this method versus direct access to the
:class:`.Cache` is that the configuration parameters
declared in ``<%page>`` take effect here, thereby calling
up the same configured backend as that configured
by ``<%page>``.

)cacherR   )r   r=   r*   s   &&,r   
get_cachedNamespace.get_cached  s     zz~~c,V,,r   c                .    V P                   P                  # )zgReturn the :class:`.Cache` object referenced
by this :class:`.Namespace` object's
:class:`.Template`.

)templater  r'   s   &r   r  Namespace.cache  s     }}"""r   c                H    \        V P                  WP                  3/ VB  R# )z$Include a file at the given ``uri``.N)_include_filer   r  )r   r  r*   s   &&,r   include_fileNamespace.include_file  s     	dllC):):EfEr   c                ~    V F6  pVR 8X  d    V P                  4        F	  w  rEWQV&   K  	  K)  \        W4      W&   K8  	  R# )*N)	_get_starr   )r   rc   lidentkvs   &&&   r   	_populateNamespace._populate  s;    E| NN,DAaD - #4/ r   c              #     "   V P                   '       d,   V P                    F  pWP                   V,          3x  K  	  R # R # 5ir9   )r   r<   s   & r   r  Namespace._get_star  s3     >>>~~NN3/00 & s   A Ac                    WP                   9   d   V P                   V,          pMGV P                  '       d   \        V P                  V4      pM\        R V P                  : RV: R24      h\        WV4       V# zNamespace 'z' has no member '')r   r   r   r   r   setattr)r   r=   vals   && r   r   Namespace.__getattr__  s]    .. ..%C]]]$---C 7;yy#F  	3
r   )r   r   r   r   NNTNr   )rl   rm   rn   ro   rp   r   r   r   r  r   filenamer  r  r   memoized_propertyr   r  r  r  rq   r  r  r  r  r   rr   rs   rt   s   @r   r   r   j  s     @ IF H
 G H C L	  @F- # #F
01

 
r   r   c                   j   a  ] tR tRt o RtRR lt]R 4       t]R 4       t]R 4       t	R t
R	 tR
tV tR# )r  i,  z@A :class:`.Namespace` specific to a :class:`.Template` instance.Nc	                   Wn         W n        W`n        Ve"   V U	u/ uF  qP                  V	bK  	  up	V n        Ve8   \        W$V4      V n        V P                  P                  P                  V n	        M1Ve#   W0n        VP                  P                  V n	        M\        R4      hV'       d   \        W P                  V R7      w  rR # R # u up	i )Nz 'template' argument is required.)self_ns)r   r   r   rl   r   r  r  r   _template_urir  	TypeError_populate_self_namespace)r   r   r   r  r   r   r   r   r   r^   lclcallable
lclcontexts   &&&&&&&&&   r   r   TemplateNamespace.__init__0  s     	  5>?Yjj!mY?DN",W;ODM $ 4 4 B BD!$M ( = =D>??&>'#K  @s   C	c                .    V P                   P                  # )zThe Python module referenced by this :class:`.Namespace`.

If the namespace references a :class:`.Template`, then
this module is the equivalent of ``template.module``,
i.e. the generated module for the template.

)r  r   r'   s   &r   r   TemplateNamespace.moduleO  s     }}###r   c                .    V P                   P                  # zXThe path of the filesystem file used for this
:class:`.Namespace`'s module or template.
)r  r'  r'   s   &r   r'  TemplateNamespace.filenameZ  s    
 }}%%%r   c                .    V P                   P                  # )zThe URI for this :class:`.Namespace`'s template.

I.e. whatever was sent to :meth:`.TemplateLookup.get_template()`.

This is the equivalent of :attr:`.Template.uri`.

)r  r  r'   s   &r   r  TemplateNamespace.uria  s     }}   r   c              #     a "   S P                   '       d+   S P                    F  pVS P                   V,          3x  K  	  V 3R  lpS P                  P                  P                   F  pW2! V4      3x  K  	  R# 5i)c                 |   < SP                   P                  V 4      p\        P                  ! VSP                  4      # r9   )r  _get_def_callabler   r   r   )r=   	callable_r   s   & r   rR   (TemplateNamespace._get_star.<locals>.getq  s.    77<I$$Y==r   N)r   r  r   _exports)r   r=   rR   r  s   f   r   r  TemplateNamespace._get_starl  s`     >>>~~DNN3/00 &	> %%..Ac!f+ /s   A7A:c                   WP                   9   d   V P                   V,          pMV P                  P                  V4      '       d=   V P                  P                  V4      p\        P
                  ! W0P                  4      pMGV P                  '       d   \        V P                  V4      pM\        R V P                  : RV: R24      h\        WV4       V# r!  )r   r  has_defr;  r   r   r   r   r   r   r   r#  r   r=   r$  r<  s   &&  r   r   TemplateNamespace.__getattr__x  s    .. ..%C]]""3''77<I##I||<C]]]$---C !7;yy#F  	3
r   )r  r   r   r   r   r  )NNNNTN)rl   rm   rn   ro   rp   r   rq   r   r'  r  r  r   rr   rs   rt   s   @r   r  r  ,  sX     J> $ $ & & ! !
 r   r  c                   J   a  ] tR tRt o RtR	R lt]R 4       tR tR t	Rt
V tR# )
ModuleNamespacei  z;A :class:`.Namespace` specific to a Python module instance.Nc                    Wn         W n        WPn        Ve"   V Uu/ uF  qP                  VbK  	  upV n        \        V4      p	VP                  R4      R,           F  p
\        W4      p	K  	  Wn        R # u upi )N.:r   NN)	r   r   r   rl   r   
__import__splitr   r   )r   r   r   r   r   r   r   r   r^   modtokens   &&&&&&&&   r   r   ModuleNamespace.__init__  so     	  5>?Yjj!mY?DN \\#&r**E#%C + @s   A5c                .    V P                   P                  # r5  )r   __file__r'   s   &r   r'  ModuleNamespace.filename  s    
 {{###r   c              #  v  "   V P                   '       d*   V P                    F  pWP                   V,          3x  K  	  \        V P                  4       F`  pV^ ,          R8w  g   K  \        V P                  V4      p\	        V4      '       g   K<  V\
        P                  ! W P                  4      3x  Kb  	  R# 5i)r   _N)r   dirr   r   callabler   r   r   )r   r=   r<  s   &  r   r  ModuleNamespace._get_star  s     >>>~~NN3/00 &t{{#C1v}#DKK5	I&&y00LLIII	 $s   AB9&$B9*B9c                   WP                   9   d   V P                   V,          pM\        V P                  V4      '       d8   \        V P                  V4      p\        P
                  ! W0P                  4      pMGV P                  '       d   \        V P                  V4      pM\        R V P                  : RV: R24      h\        WV4       V# r!  )r   r   r   r   r   r   r   r   r   r   r#  rB  s   &&  r   r   ModuleNamespace.__getattr__  s    .. ..%CT[[#&&S1I##I||<C]]]$---C 7;yy#F  	3
r   )r   r   r   r   r   r&  )rl   rm   rn   ro   rp   r   rq   r'  r  r   rr   rs   rt   s   @r   rE  rE    s1     E* $ $J r   rE  c                   a  V 3R lpV# )zApply a caller_stack compatibility decorator to a plain
Python function.

See the example in :ref:`namespaces_python_modules`.

c                    < V P                   P                  4         S! V .VO5/ VB V P                   P                  4        #   T P                   P                  4        i ; ir9   )r   r   r   )r   argsr*   funcs   &*,r   wrap_stackframe(supports_caller.<locals>.wrap_stackframe  sQ    ((*	.1$1&1  ++-G  ++-s   A Ar   )rZ  r[  s   f r   supports_callerr]    s    . r   c                    \        V4      '       g   \        P                  ! R4      hV P                  4         V! V/ VB  V P	                  4       pVP                  4       #   T P	                  4       pi ; i)z{Execute the given template def, capturing the output into
a buffer.

See the example in :ref:`namespaces_python_modules`.

z[capture() function expects a callable as its argument (i.e. capture(func, *args, **kwargs)))rS  r   r   rL   rO   getvalue)r   r<  rY  r*   rD   s   &&*, r   r   r     st     I))A
 	
 $4"6"!!#<<> !!#s   A! !A3c                    a  V 3R  lpV# )c                    <a  VV 3R  lpV# )c                    <a  V V3R  lp SP                   R,          Vn         S! V4      ! S .VO5/ VB #   \         d     Li ; i)c                     < S! S.V O5/ VB # r9   r   )rY  kwr   	render_fns   *,r   yB_decorate_toplevel.<locals>.decorate_render.<locals>.go.<locals>.y  s     646266r   :   NN)rl   r-  )r   rY  rd  rf  fnre  s   f*, r   go7_decorate_toplevel.<locals>.decorate_render.<locals>.go  sN    7&//3
 a5.4.2..  s   5 AAr   )re  rj  ri  s   f r   decorate_render+_decorate_toplevel.<locals>.decorate_render  s    		/ 	r   r   )ri  rl  s   f r   _decorate_toplevelrn    s     r   c                    a a V V3R  lpV# )c                 (   <a S! V 4      oVV3R  lpV# )c                     < S! S.V O5/ VB # r9   r   )rY  rd  r   decs   *,r   rj  5_decorate_inline.<locals>.decorate_render.<locals>.go   s    w,,,,r   r   )re  rj  rr  r   ri  s   & @r   rl  )_decorate_inline.<locals>.decorate_render  s    m	- 	r   r   )r   ri  rl  s   ff r   _decorate_inlineru    s     r   c                P   \        WV4      p\        V P                  4       V4      w  rV\        WPP                  3/ VB pVP
                  '       d    V! V3/ VB  R# V! V3/ VB  R#   \         d3    TP                  T\        P                  ! 4       4      pT'       g   h  R# i ; i)zLlocate the template from the given uri and include it in
the current output.N)	r  r.  rj   _kwargs_for_includer   include_error_handler	Exceptionr   exception_as)r   r  r   r*   r  r<  ctxresults   &&&,    r   r  r    s      k:H/))+XY !MMDVDF%%%	c$V$ 	#    	33C9L9L9NOF 	s   	A( (7B% B%$B%c                   Vf   R# \        WV4      pV R,          pTpVP                  e   VP                  pK  V P                  RV/4      p\        RVP                  ,          VVRR7      Vn        VP                  ;V P
                  R&   VP
                  R&   \        VP                  R	R4      pVe   V! W64      pV'       d   V# \        VP                  R
R4      p	V	e	   V	! V 4       VP                  V3# )zycalled by the _inherit method in template modules to set
up the inheritance chain at the start of a template's
execution.Nr   rh   self:%sFr  r   rg   local_mako_inherit_mako_generate_namespaces)	r  r   rd   r  r  r   r   r   r<  )
r   r  r   r  r+  ihr0  r<  retgen_nss
   &&&       r   _inherit_fromr    s    
 {k:HfoG	B
++
![[&".J#HLL 	BK ;=++EGMM(j..w7$?I-JX__&A4HFw
++r   c                 ~   V P                   P                  pVf2   \        P                  ! RV P                   P                  ,          4      hVP                  W4      p VP                  V4      #   \        P                   d9   p\        P                  ! \        \        P                  ! 4       4      4      ThR p?ii ; i)Nz.Template '%s' has no TemplateLookup associated)r   r&   r   TemplateLookupExceptionr  
adjust_urir  TopLevelLookupExceptionstrr   rz  )r   r  
relativetor&   es   &&&  r   r  r  <  s    ##**F~00<$$(()
 	
 

C
,C""3''-- 00##%&
	s   A/ /B<3B77B<c                 $   Vf!   \        RVP                  ,          V VRR7      pV;V P                  R&   V P                  R&   \        VP                  R4      '       d&   VP                  P                  W4      pV'       d   V# VP                  V 3# )Nr~  Fr  r   r  r  )r  r  r   r   r   r  r<  )r   r  r+  r  s   &&& r   r.  r.  L  s    #$	
 6=<GMM&GMM'2x00oo++H>J((r   c                L   V'       d   \         P                  ! 4       pM,\         P                  ! V P                  V P                  R7      p\	        V3/ VB pWFn        VP                  V 4       \        V VV.VO5/ \        W4      B  VP                  4       P                  4       # )zZcreate a Context and return the string
output of the given template and template callable.)encodingerrors)r   rA   output_encodingencoding_errorsr   r   r#   _render_context_kwargs_for_callablerO   r_  )r  r<  rY  r   
as_unicoderD   r   s   &&&&&  r   _renderr  \  s     %%'%%--h6N6N
 c"T"G%/"x( 
	
 y
/  ))++r   c                    \         P                  ! V 4      pV^,          '       d   V# V^ ,          VR,           Uu. uF
  q3f   K  VNK  	  up,           p/ pV F&  pVR8w  g   K  Wa9   g   K  We9  g   K  W,          WV&   K(  	  V# u upi )r   r      Nr   r   inspect_getargspec)r<  r   argspecr  	namedargsr*   args   &&     r   r  r  t  s{    ''	2Gqzz 
GAaaGGIF)0A)FK  M Hs   BBc                     \         P                  ! V 4      pV^ ,          VR,           Uu. uF
  qDf   K  VNK  	  up,           pV F&  pVR8w  g   K  Wa9   g   K  Wb9  g   K  W,          W&&   K(  	  V# u upi )r   r  r   r  )r<  r   r*   r  r  r  r  s   &&,    r   rw  rw    sf    ''	2G
GAaaGGI)0A)FK  M	 Hs
   A1A1c                     ^ RI Hp \        WP                  4      '       g   \	        W 4      w  rg\        WgW4R7       R# \	        W P                  4      w  rg\        WW4R7       R# )r   N)rY  r*   )mako.templater  
isinstanceDefTemplater.  _exec_templaterg   )tmplr<  r   rY  r*   r  inheritr0  s   &&&*,   r   r  r    sL    $ d0011 8 GwE !9++ NyDr   c                \   VP                   pVe4   VP                  '       g   VP                  '       d    V ! V.VO5/ VB  R# V ! V.VO5/ VB  R#   \         d$    \	        YA\
        P                  ! 4       4        R#  \        P                  ! 4       ^ ,          p\	        YAT4        R# ; i)zexecute a rendering callable given the callable, a
Context, and optional explicit arguments

the contextual Template will be located if it exists, and
the error handling options specified on that Template will
be interpreted here.
N)	r   format_exceptionserror_handlerry  _render_errorr   rz  sysexc_info)r<  r   rY  r*   r  r  s   &&&&  r   r  r    s     %%H"""h&<&<&<	0g/// 	'+D+F+  	D(V-@-@-BC	0q!A(Q/s   A *B+?)B+c                 $   V P                   '       dW   V P                  W4      pV'       g<   \        P                  ! 4       w  rEpV'       d   V'       d   VP                  V4      hVhR# \        P
                  ! 4       pVP                  '       d%   \        P                  ! 4       .VP                  R &   M9\        P                  ! VP                  VP                  4      .VP                  R &   VP                  V4       VP                  WR7       R# ):NNN)errorN)r  r  r  with_tracebackr   html_error_templater   r   rA   r
   r  r  r#   render_context)r  r   r  r|  tpvaluetberror_templates   &&&     r   r  r    s    ''7LLNMBr**2..  $779)))(,(?(?(A'BG!!!$ ''"22"22(G!!!$ 	"">2%%g%;r   r9   r   )NN)"rp   r:   r   r  makor   r   r   r   r5   r   r   	UNDEFINEDSTOP_RENDERINGr   r   r   r   r  rE  r]  r   rn  ru  r  r  r  r.  r  r  rw  r  r  r  r   r   r   <module>r     s   ,   
   i iX%$ %8 ( K	% %P>0 >0B" " DZ	 Zz7i 7t$*$	!(,@ ) ,0E,.<r   