ó
    ùÞ j�l  ã                   óp  • S r SSKrSSKrSSKrSSKJr  SSKJr  SSKJr   " S S5      r " S S	\	5      r
 " S
 S5      r\" 5       rSr " S S5      r " S S5      r " S S5      r " S S5      r " S S\5      r " S S\5      rS rS rS rS rS rS rS rS'S  jrS(S! jrS" rS# rS$ rS)S% jr S& r!g)*zdprovides runtime services for templates, including Context,
Namespace, and various helper functions.é    N)Úcompat)Ú
exceptions)Úutilc                   óœ   • \ rS rSrSrS rS r\S 5       r\S 5       r	S r
S rS	 rS
 rS rS rS rS rSS jrS rS rS rS rS rSrg)ÚContexté   z�Provides runtime namespace, output buffer, and various
callstacks for templates.

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

c                 ó   • U/U l         X l        UR                  5       U l        S U l        S U l        0 U l        [        R                  " [        U 5      U R                  S'   [        5       =U l        U R                  S'   g )NÚcaptureÚcaller)Ú_buffer_stackÚ_dataÚcopyÚ_kwargsÚ_with_templateÚ_outputting_as_unicodeÚ
namespacesÚ	functoolsÚpartialr
   ÚCallerStackÚcaller_stack)ÚselfÚbufferÚdatas      ÚF/var/www/html/gaurav/venv/lib/python3.13/site-packages/mako/runtime.pyÚ__init__ÚContext.__init__   sl   € Ø$˜XˆÔàŒ
à—y‘y“{ˆŒØ"ˆÔØ&*ˆÔ#ØˆŒô !*× 1Ò 1´'¸4Ó @ˆ�
‰
�9Ñô 4?³=Ð@ˆÔ˜DŸJ™J xÒ0ó    c                 ó¸   • Xl         UR                  R                  U R                  5      nU(       a(  [        R
                  " SSR                  U5      -  5      eg )Nz%Reserved words passed to render(): %sz, )r   Úreserved_namesÚintersectionr   r   ÚNameConflictErrorÚjoin)r   ÚtÚillegal_namess      r   Ú_set_with_templateÚContext._set_with_template-   sQ   € ØÔØ×(Ñ(×5Ñ5°d·j±jÓAˆÞÜ×.Ò.Ø7Ø—)‘)˜MÓ*ñ+óð ð r   c                 ó.   • U R                   R                  $ )zMReturn the :class:`.TemplateLookup` associated
with this :class:`.Context`.

)r   Úlookup©r   s    r   r(   ÚContext.lookup6   s   € ð ×"Ñ"×)Ñ)Ð)r   c                 ó6   • U R                   R                  5       $ )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                 ó:   • U R                   R                  U5        g)zIPush a ``caller`` callable onto the callstack for
this :class:`.Context`.N)r   Úappend)r   r   s     r   Úpush_callerÚContext.push_callerT   s   € ð 	×Ñ× Ñ  Õ(r   c                 ó   • U R                   S	 g)zHPop a ``caller`` callable onto the callstack for this
:class:`.Context`.éÿÿÿÿN)r   r)   s    r   Ú
pop_callerÚContext.pop_callerZ   s   € ð ×Ñ˜bÑ!r   c                 óH   • [        U R                  R                  5       5      $ )zAReturn a list of all names established in this :class:`.Context`.)Úlistr   Úkeysr)   s    r   r8   ÚContext.keys`   s   € ô �D—J‘J—O‘OÓ%Ó&Ð&r   c                 ód   • XR                   ;   a  U R                   U   $ [        R                  U   $ ©N)r   ÚbuiltinsÚ__dict__©r   Úkeys     r   Ú__getitem__ÚContext.__getitem__e   s+   € Ø—*‘*ÓØ—:‘:˜c‘?Ð"ä×$Ñ$ SÑ)Ð)r   c                 óz   • [         R                  " 5       nU R                  R                  U5        UR                  $ )zMpush a capturing buffer onto this Context and return
the new writer function.)r   ÚFastEncodingBufferr   r/   Úwrite©r   Úbufs     r   Ú_push_writerÚContext._push_writerk   s0   € ô ×%Ò%Ó'ˆØ×Ñ×!Ñ! #Ô&Ø�y‰yÐr   c                 ój   • U R                   R                  5       nXR                   S   R                  4$ )zepop the most recent capturing buffer from this Context
and return the current writer after the pop.

r3   )r   ÚpoprD   rE   s     r   Ú_pop_buffer_and_writerÚContext._pop_buffer_and_writers   s2   € ð × Ñ ×$Ñ$Ó&ˆØ×&Ñ& rÑ*×0Ñ0Ð0Ð0r   c                 ó$   • U R                  5         g)z*push a capturing buffer onto this Context.N)rG   r)   s    r   Ú_push_bufferÚContext._push_buffer|   s   € ð 	×ÑÕr   c                 ó6   • U R                   R                  5       $ )z7pop the most recent capturing buffer from this Context.)r   rJ   r)   s    r   Ú_pop_bufferÚContext._pop_buffer�   s   € ð ×!Ñ!×%Ñ%Ó'Ð'r   Nc                 ót   • U R                   R                  U[        R                  R                  X5      5      $ )z+Return a value from this :class:`.Context`.)r   Úgetr<   r=   )r   r?   Údefaults      r   rT   ÚContext.get†   s*   € ð �z‰z�~‰~˜c¤8×#4Ñ#4×#8Ñ#8¸Ó#FÓGÐGr   c                 ó@   • U R                   S   R                  U5        g)zKWrite a string to this :class:`.Context` object's
underlying output buffer.r3   N©r   rD   )r   Ústrings     r   rD   ÚContext.write‹   s   € ð 	×Ñ˜2Ñ×$Ñ$ VÕ,r   c                 ó4   • U R                   S   R                  $ )z#Return the current writer function.r3   rX   r)   s    r   ÚwriterÚContext.writer‘   s   € ð ×!Ñ! "Ñ%×+Ñ+Ð+r   c                 óB  • [         R                  [         5      nU R                  Ul        U R                  R	                  5       Ul        U R
                  Ul        U R                  Ul        U R                  Ul        U R                  Ul        U R                  Ul	        U$ r;   )
r   Ú__new__r   r   r   r   r   r   r   r   )r   Úcs     r   Ú_copyÚContext._copy–   ss   € Ü�O‰OœGÓ$ˆØ×,Ñ,ˆŒØ—*‘*—/‘/Ó#ˆŒØ—L‘LˆŒ	Ø×.Ñ.ˆÔØ#'×#>Ñ#>ˆÔ Ø—‘ˆŒØ×*Ñ*ˆŒØˆr   c                 ón   • U(       d  U $ U R                  5       nUR                  R                  U5        U$ )z·Create 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.


)ra   r   Úupdate)r   Údr`   s      r   Ú_localsÚContext._locals¡   s,   € ö ØˆKØ�J‰J‹LˆØ	�‰�‰�qÔØˆr   c                 óª   • U R                  5       nUR                  nUR                  SS5        UR                  SS5        UR                  SS5        U$ )z^create a new copy of this :class:`.Context`. with
tokens related to inheritance state removed.r   NÚparentÚnext)ra   r   rJ   )r   r`   Úxs      r   Ú_clean_inheritance_tokensÚ!Context._clean_inheritance_tokens²   sG   € ð �J‰J‹LˆØ�G‰GˆØ	�‰ˆf�dÔØ	�‰ˆh˜ÔØ	�‰ˆf�dÔØˆr   )r   r   r   r   r   r   r   r;   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r%   Úpropertyr(   r,   r0   r4   r8   r@   rG   rK   rN   rQ   rT   rD   r\   ra   rf   rl   Ú__static_attributes__© r   r   r   r      s�   † ñòAò"ð ñ*ó ð*ð ñ#ó ð#ò*)ò"ò'ò
*òò1òò
(ô
Hò
-ò,ò
	òõ"	r   r   c                   ó>   • \ rS rSrS rS rS rS rS rS r	S r
S	rg
)r   é¾   c                 ó   • S U l         g r;   ©Ú
nextcallerr)   s    r   r   ÚCallerStack.__init__¿   s	   € Øˆ�r   c                 ó"   • U R                  5       $ r;   ©Ú__bool__r)   s    r   Ú__nonzero__ÚCallerStack.__nonzero__Â   ó   € Ø�}‰}‹Ðr   c                 ój   • [        U 5      =(       a    U R                  5       =(       a    S=(       d    S$ )NTF)ÚlenÚ_get_callerr)   s    r   r~   ÚCallerStack.__bool__Å   s$   € Ü�4‹y×8˜T×-Ñ-Ó/×8°D×A¸EÐAr   c                 ó   • U S   $ ©Nr3   ru   r)   s    r   r„   ÚCallerStack._get_callerÈ   s   € ð �B‰xˆr   c                 ó6   • [        U R                  5       U5      $ r;   )Úgetattrr„   r>   s     r   Ú__getattr__ÚCallerStack.__getattr__Í   s   € Ü�t×'Ñ'Ó)¨3Ó/Ð/r   c                 ó`   • U R                   =(       d    S nU R                  U5        S U l         U$ r;   )rz   r/   )r   Úframes     r   Ú_push_frameÚCallerStack._push_frameÐ   s(   € Ø—‘×' 4ˆØ�‰�EÔØˆŒØˆr   c                 ó.   • U R                  5       U l        g r;   )rJ   rz   r)   s    r   Ú
_pop_frameÚCallerStack._pop_frameÖ   s   € ØŸ(™(›*ˆ�r   ry   N)rn   ro   rp   rq   r   r   r~   r„   r‹   r�   r’   rt   ru   r   r   r   r   ¾   s&   † òòòBòò
0òõ%r   r   c                   ó*   • \ rS rSrSrS rS rS rSrg)Ú	UndefinedéÚ   z•Represents an undefined value in a template.

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

c                 ó   • [        S5      e)Nr•   )Ú	NameErrorr)   s    r   Ú__str__ÚUndefined.__str__ã   s   € Ü˜Ó$Ð$r   c                 ó"   • U R                  5       $ r;   r}   r)   s    r   r   ÚUndefined.__nonzero__æ   r�   r   c                 ó   • g)NFru   r)   s    r   r~   ÚUndefined.__bool__é   s   € Ør   ru   N)	rn   ro   rp   rq   rr   r™   r   r~   rt   ru   r   r   r•   r•   Ú   s   † ñò%òõr   r•   Ú c                   óR   • \ rS rSrSrS rS rS r\S 5       r	S r
S rS	 rS
 rSrg)Ú	LoopStackéñ   z„a stack for LoopContexts that implements the context manager protocol
to automatically pop off the top of the stack on context exit
c                 ó   • / U l         g r;   ©Ústackr)   s    r   r   ÚLoopStack.__init__ö   s	   € Øˆ�
r   c                 ó<   • U R                  U5        U R                  $ r;   )Ú_pushÚ_top©r   Úiterables     r   Ú_enterÚLoopStack._enterù   s   € Ø�
‰
�8ÔØ�y‰yÐr   c                 ó:   • U R                  5         U R                  $ r;   )Ú_popr©   r)   s    r   Ú_exitÚLoopStack._exitý   s   € Ø�	‰	ŒØ�y‰yÐr   c                 óF   • U R                   (       a  U R                   S   $ U $ r‡   r¤   r)   s    r   r©   ÚLoopStack._top  s   € à�:�:Ø—:‘:˜b‘>Ð!àˆKr   c                 ó6   • U R                   R                  5       $ r;   )r¥   rJ   r)   s    r   r¯   ÚLoopStack._pop  s   € Ø�z‰z�~‰~ÓÐr   c                 ó˜   • [        U5      nU R                  (       a  U R                  S   Ul        U R                  R                  U5      $ r‡   )ÚLoopContextr¥   ri   r/   )r   r«   Únews      r   r¨   ÚLoopStack._push  s7   € Ü˜(Ó#ˆØ�:�:ØŸ™ B™ˆCŒJØ�z‰z× Ñ  Ó%Ð%r   c                 ó.   • [         R                  " S5      e)NzNo loop context is established)r   ÚRuntimeExceptionr>   s     r   r‹   ÚLoopStack.__getattr__  s   € Ü×)Ò)Ð*JÓKÐKr   c                 ó,   • [        U R                  5      $ r;   )Úiterr©   r)   s    r   Ú__iter__ÚLoopStack.__iter__  s   € Ü�D—I‘I‹Ðr   r¤   N)rn   ro   rp   rq   rr   r   r¬   r°   rs   r©   r¯   r¨   r‹   r¿   rt   ru   r   r   r¡   r¡   ñ   s?   † ñòòòð ñó ðò ò&òLõr   r¡   c                   óž   • \ rS rSrSrS rS r\R                  S 5       r	\
S 5       r\
S 5       r\
S 5       r\
S	 5       r\
S
 5       rS rSrg)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                 ó,   • Xl         SU l        S U l        g ©Nr   ©Ú	_iterableÚindexri   rª   s     r   r   ÚLoopContext.__init__/  s   € Ø!ŒØˆŒ
Øˆ�r   c              #   ód   #   • U R                    H  nUv •  U =R                  S-  sl        M     g 7f©Né   )rÅ   rÆ   )r   Úis     r   r¿   ÚLoopContext.__iter__4  s%   é € Ø—”ˆAØŠGØ�JŠJ˜!‰O�Jò  ùs   ‚.0c                 ó,   • [        U R                  5      $ r;   )rƒ   rÅ   r)   s    r   Ú__len__ÚLoopContext.__len__9  s   € ä�4—>‘>Ó"Ð"r   c                 ó8   • [        U 5      U R                  -
  S-
  $ rÉ   )rƒ   rÆ   r)   s    r   Úreverse_indexÚLoopContext.reverse_index=  s   € ä�4‹y˜4Ÿ:™:Ñ%¨Ñ)Ð)r   c                 ó    • U R                   S:H  $ rÃ   )rÆ   r)   s    r   ÚfirstÚLoopContext.firstA  s   € à�z‰z˜Q‰Ðr   c                 ó8   • U R                   [        U 5      S-
  :H  $ rÉ   )rÆ   rƒ   r)   s    r   ÚlastÚLoopContext.lastE  s   € à�z‰zœS ›Y¨™]Ñ*Ð*r   c                 ó$   • U R                   (       + $ r;   )Úoddr)   s    r   ÚevenÚLoopContext.evenI  s   € à—8‘8Œ|Ðr   c                 ó2   • [        U R                  S-  5      $ )Né   )ÚboolrÆ   r)   s    r   rÚ   ÚLoopContext.oddM  s   € ä�D—J‘J ‘NÓ#Ð#r   c                 óZ   • U(       d  [        S5      eXR                  [        U5      -     $ )z,Cycle through values as the loop progresses.z(You must provide values to cycle through)Ú
ValueErrorrÆ   rƒ   )r   Úvaluess     r   ÚcycleÚLoopContext.cycleQ  s'   € æÜÐGÓHÐHØ—j‘j¤3 v£;Ñ.Ñ/Ð/r   rÄ   N)rn   ro   rp   rq   rr   r   r¿   r   Úmemoized_instancemethodrÎ   rs   rÑ   rÔ   r×   rÛ   rÚ   rä   rt   ru   r   r   r·   r·     s”   † ñò,ò
ð
 
×!Ñ!ñ#ó "ð#ð ñ*ó ð*ð ñó ðð ñ+ó ð+ð ñó ðð ñ$ó ð$õ0r   r·   c                   ó    • \ rS rSrS rS rSrg)Ú_NSAttriX  c                 ó   • Xl         g r;   )Ú_NSAttr__parent)r   ri   s     r   r   Ú_NSAttr.__init__Y  s   € Ø�r   c                 óÊ   • U R                   nU(       aF  [        UR                  U5      (       a  [        UR                  U5      $ UR                  nU(       a  MF  [        U5      er;   )rê   ÚhasattrÚmodulerŠ   ÚinheritsÚAttributeError)r   r?   Únss      r   r‹   Ú_NSAttr.__getattr__\  sM   € Ø�]‰]ˆÞÜ�r—y‘y #×&Ñ&Ü˜rŸy™y¨#Ó.Ð.à—[‘[�÷	 ˆbô
 ˜SÓ!Ð!r   )Ú__parentN)rn   ro   rp   rq   r   r‹   rt   ru   r   r   rè   rè   X  s   † òõ"r   rè   c                   ó®   • \ rS rSrSr    SS jrSrSr Sr Sr	 Sr
 Sr Sr\R                  S 5       rS rS rS	 r\S
 5       rS rS rS rS rSrg)Ú	Namespaceif  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                 ó|   • Xl         X l        X@l        Ub"  U Vs0 sH  owR                  U_M     snU l        g g s  snf r;   )ÚnameÚcontextrï   rn   Ú	callables)r   r÷   rø   rù   rï   Úpopulate_selfÚcalling_urir`   s           r   r   ÚNamespace.__init__v  s=   € ð Œ	ØŒØ ŒØÑ Ù5>Ó?±Y°Ÿj™j¨!šm±YÑ?ˆD�Nð !ùÚ?s   š9ru   c                 ó   • [        U 5      $ )zõAccess 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                 óü   • X4nX R                   R                  ;   a  U R                   R                  U   $ [        UU R                   R                  5       UU R                  S9nX0R                   R                  U'   U$ )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   ÚTemplateNamespacera   Ú_templateuri)r   Úurir?   rñ   s       r   Úget_namespaceÚNamespace.get_namespaceÈ  sr   € ð( ˆkˆØ—,‘,×)Ñ)Ó)Ø—<‘<×*Ñ*¨3Ñ/Ð/ÜØØ�L‰L×ÑÓ ØØ×)Ñ)ñ	
ˆð (*�‰×Ñ Ñ$Øˆ	r   c                 óB   • [        U R                  XR                  5      $ )z¡Return 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   € ô   §¡¨c×3DÑ3DÓEÐEr   c                 ó<   • U R                   R                  " U40 UD6$ )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>``.

)ÚcacherT   )r   r?   r,   s      r   Ú
get_cachedÚNamespace.get_cachedñ  s   € ð �z‰z�~Š~˜cÑ, VÑ,Ð,r   c                 ó.   • U R                   R                  $ )zgReturn the :class:`.Cache` object referenced
by this :class:`.Namespace` object's
:class:`.Template`.

)Útemplater  r)   s    r   r  ÚNamespace.cacheÿ  s   € ð �}‰}×"Ñ"Ð"r   c                 óF   • [        U R                  XR                  40 UD6  g)z$Include a file at the given ``uri``.N)Ú_include_filerø   r  )r   r  r,   s      r   Úinclude_fileÚNamespace.include_file  s   € ô 	�d—l‘l C×):Ñ):ÑE¸fÓEr   c                 óz   • U H5  nUS:X  a  U R                  5        H	  u  pEXQU'   M     M(  [        X5      X'   M7     g )NÚ*)Ú	_get_starrŠ   )r   re   ÚlÚidentÚkÚvs         r   Ú	_populateÚNamespace._populate  s;   € ÛˆEØ˜‹|Ø ŸN™NÖ,‘D�AØ�a“Dó -ô # 4Ó/�“ò r   c              #   óz   #   • U R                   (       a&  U R                    H  nXR                   U   4v •  M     g g 7fr;   )rù   r>   s     r   r  ÚNamespace._get_star  s1   é € Ø�>�>Ø—~”~�ØŸN™N¨3Ñ/Ð0Ô0ò &ð ùs   ‚9;c                 óè   • XR                   ;   a  U R                   U   nOFU R                  (       a  [        U R                  U5      nO[        SU R                  < SU< S35      e[        XU5        U$ ©NzNamespace 'z' has no member 'Ú')rù   rï   rŠ   rð   r÷   Úsetattr)r   r?   Úvals      r   r‹   ÚNamespace.__getattr__  s[   € Ø—.‘.Ó Ø—.‘. Ñ%‰CØ�]�]Ü˜$Ÿ-™-¨Ó-‰Cå Ø7;·y´yÃ#ÐFóð ô 	�˜3ÔØˆ
r   )rù   rø   rï   r÷   ©NNTN)rn   ro   rp   rq   rr   r   rù   rî   r  rø   Úfilenamer  r  r   Úmemoized_propertyrþ   r  r	  r  rs   r  r  r  r  r‹   rt   ru   r   r   rõ   rõ   f  sµ   † ñð& ØØØô@ð €Ià€Fðð €Hðð
 €Gðð €Hðð €Cðð €Là	×Ññó ðò ò@Fò-ð ñ#ó ð#òFò
0ò1õ

r   rõ   c                   ój   • \ rS rSrSr      SS jr\S 5       r\S 5       r\S 5       r	S r
S	 rS
rg)r  i'  z@A :class:`.Namespace` specific to a :class:`.Template` instance.Nc	                 óŠ  • Xl         X l        X`l        Ub!  U V	s0 sH  o™R                  U	_M     sn	U l        Ub7  [        X$U5      U l        U R                  R                  R                  U l	        O0Ub"  X0l        UR                  R                  U l	        O[        S5      eU(       a  [        X R                  U S9u  p«g g s  sn	f )Nz 'template' argument is required.)Úself_ns)r÷   rø   rï   rn   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__*  s°   € ð Œ	ØŒØ ŒØÑ Ù5>Ó?±Y°Ÿj™j¨!šm±YÑ?ˆDŒNàÑ"Ü,¨WÀ;ÓOˆDŒMØ $§¡× 4Ñ 4× BÑ BˆDÕØÑ!Ø$ŒMØ (§¡× =Ñ =ˆDÕäÐ>Ó?Ð?æÜ&>ØŸ™°ñ'Ñ#ˆK˜ð ùò @s   šC c                 ó.   • U R                   R                  $ )zÕThe 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.moduleI  s   € ð �}‰}×#Ñ#Ð#r   c                 ó.   • U R                   R                  $ ©zXThe path of the filesystem file used for this
:class:`.Namespace`'s module or template.
)r  r(  r)   s    r   r(  ÚTemplateNamespace.filenameT  s   € ð
 �}‰}×%Ñ%Ð%r   c                 ó.   • U R                   R                  $ )z§The 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.uri[  s   € ð �}‰}× Ñ Ð r   c              #   óì   ^ #   • T R                   (       a&  T R                    H  nUT R                   U   4v •  M     U 4S jnT R                  R                  R                   H  nX2" U5      4v •  M     g 7f)Nc                 ó|   >• TR                   R                  U 5      n[        R                  " UTR                  5      $ r;   )r  Ú_get_def_callabler   r   rø   )r?   Ú	callable_r   s     €r   rT   Ú(TemplateNamespace._get_star.<locals>.getk  s.   ø€ ØŸ™×7Ñ7¸Ó<ˆIÜ×$Ò$ Y°·±Ó=Ð=r   )rù   r  rî   Ú_exports)r   r?   rT   r  s   `   r   r  ÚTemplateNamespace._get_starf  s^   øé € Ø�>�>Ø—~”~�Ø˜DŸN™N¨3Ñ/Ð0Ô0ñ &õ	>ð —‘×%Ñ%×.Ô.ˆAØ�c˜!“f�+Ôò /ùs   ƒA1A4c                 ó   • XR                   ;   a  U R                   U   nO¢U R                  R                  U5      (       a<  U R                  R                  U5      n[        R
                  " X0R                  5      nOFU R                  (       a  [        U R                  U5      nO[        SU R                  < SU< S35      e[        XU5        U$ r"  )rù   r  Úhas_defr<  r   r   rø   rï   rŠ   rð   r÷   r$  ©r   r?   r%  r=  s       r   r‹   ÚTemplateNamespace.__getattr__r  sš   € Ø—.‘.Ó Ø—.‘. Ñ%‰CØ�]‰]×"Ñ" 3×'Ñ'ØŸ™×7Ñ7¸Ó<ˆIÜ×#Ò# I¯|©|Ó<‰CØ�]�]Ü˜$Ÿ-™-¨Ó-‰Cõ !Ø7;·y´yÃ#ÐFóð ô 	�˜3ÔØˆ
r   )r  rù   rø   rï   r÷   r  )NNNNTN)rn   ro   rp   rq   rr   r   rs   rî   r(  r  r  r‹   rt   ru   r   r   r  r  '  sd   † ÙJð ØØØØØôð> ñ$ó ð$ð ñ&ó ð&ð ñ!ó ð!ò
õr   r  c                   óF   • \ rS rSrSr    S	S jr\S 5       rS rS r	Sr
g)
ÚModuleNamespaceiƒ  z;A :class:`.Namespace` specific to a Python module instance.Nc                 óè   • Xl         X l        XPl        Ub!  U Vs0 sH  oˆR                  U_M     snU l        [        U5      n	UR                  S5      SS   H  n
[        Xš5      n	M     X�l        g s  snf )NÚ.rÊ   )	r÷   rø   rï   rn   rù   Ú
__import__ÚsplitrŠ   rî   )r   r÷   rø   rî   rù   rï   rú   rû   r`   ÚmodÚtokens              r   r   ÚModuleNamespace.__init__†  sn   € ð Œ	ØŒØ ŒØÑ Ù5>Ó?±Y°Ÿj™j¨!šm±YÑ?ˆDŒNä˜Ó ˆØ—\‘\ #Ó& q rÓ*ˆEÜ˜#Ó%ŠCñ +à�ùò @s   šA/c                 ó.   • U R                   R                  $ r6  )rî   Ú__file__r)   s    r   r(  ÚModuleNamespace.filename›  s   € ð
 �{‰{×#Ñ#Ð#r   c              #   ó^  #   • U R                   (       a%  U R                    H  nXR                   U   4v •  M     [        U R                  5       HZ  nUS   S:w  d  M  [        U R                  U5      n[	        U5      (       d  M6  U[
        R                  " X R                  5      4v •  M\     g 7f)Nr   Ú_)rù   Údirrî   rŠ   Úcallabler   r   rø   )r   r?   r=  s      r   r  ÚModuleNamespace._get_star¢  s   é € Ø�>�>Ø—~”~�ØŸN™N¨3Ñ/Ð0Ô0ñ &ä�t—{‘{Ö#ˆCØ�1‰v˜�}Ü# D§K¡K°Ó5�	Ü˜I×&Ó&Øœy×0Ò0°¿L¹LÓIÐIÔIò	 $ùs   ‚AB-Á$B-Â)B-c                 óŒ  • XR                   ;   a  U R                   U   nO˜[        U R                  U5      (       a7  [        U R                  U5      n[        R
                  " X0R                  5      nOFU R                  (       a  [        U R                  U5      nO[        SU R                  < SU< S35      e[        XU5        U$ r"  )rù   rí   rî   rŠ   r   r   rø   rï   rð   r÷   r$  rC  s       r   r‹   ÚModuleNamespace.__getattr__¬  s�   € Ø—.‘.Ó Ø—.‘. Ñ%‰CÜ�T—[‘[ #×&Ñ&Ü §¡¨SÓ1ˆIÜ×#Ò# I¯|©|Ó<‰CØ�]�]Ü˜$Ÿ-™-¨Ó-‰Cå Ø7;·y´yÃ#ÐFóð ô 	�˜3ÔØˆ
r   )rù   rø   rï   rî   r÷   r'  )rn   ro   rp   rq   rr   r   rs   r(  r  r‹   rt   ru   r   r   rF  rF  ƒ  s7   † ÙEð ØØØôð* ñ$ó ð$òJõr   rF  c                 ó   ^ • U 4S jnU$ )z€Apply a caller_stack compatibility decorator to a plain
Python function.

See the example in :ref:`namespaces_python_modules`.

c                 óÄ   >• U R                   R                  5          T" U /UQ70 UD6U R                   R                  5         $ ! U R                   R                  5         f = fr;   )r   r�   r’   )rø   Úargsr,   Úfuncs      €r   Úwrap_stackframeÚ(supports_caller.<locals>.wrap_stackframeÄ  sQ   ø€ Ø×Ñ×(Ñ(Ô*ð	.Ù˜Ð1 $Ò1¨&Ñ1à× Ñ ×+Ñ+Õ-øˆG× Ñ ×+Ñ+Õ-ús   �A ÁAru   )r[  r\  s   ` r   Úsupports_callerr^  ¼  s   ø€ õ.ð Ðr   c                 óê   • [        U5      (       d  [        R                  " S5      eU R                  5          U" U0 UD6  U R	                  5       nUR                  5       $ ! U R	                  5       nf = f)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)))rT  r   r»   rN   rQ   Úgetvalue)rø   r=  rZ  r,   rF   s        r   r
   r
   Î  st   € ô �I×ÑÜ×)Ò)ðAó
ð 	
ð ×ÑÔð$Ù�4Ð"˜6Ò"à×!Ñ!Ó#ˆØ�<‰<‹>Ðøð ×!Ñ!Ó#‰ús   ¸A  Á A2c                 ó   ^ • U 4S jnU$ )Nc                 ó   >^ • UU 4S jnU$ )Nc                 ó‚   >^ • U U4S jn TR                   SS  Ul         T" U5      " T /UQ70 UD6$ ! [         a     Nf = f)Nc                  ó   >• T" T/U Q70 UD6$ r;   ru   )rZ  Úkwrø   Ú	render_fns     €€r   ÚyÚB_decorate_toplevel.<locals>.decorate_render.<locals>.go.<locals>.yæ  s   ø€ Ù  Ð6¨4Ò6°2Ñ6Ð6r   é   )rn   r.  )rø   rZ  re  rg  Úfnrf  s   `   €€r   ÚgoÚ7_decorate_toplevel.<locals>.decorate_render.<locals>.goå  sP   ù€ ö7ðØ&×/Ñ/°°Ð3�”
ñ �a”5˜Ð. 4Ò.¨2Ñ.Ð.øô ó áðús   ‹1 ±
>½>ru   )rf  rk  rj  s   ` €r   Údecorate_renderÚ+_decorate_toplevel.<locals>.decorate_renderä  s   ù€ ö		/ð ˆ	r   ru   )rj  rm  s   ` r   Ú_decorate_toplevelro  ã  s   ø€ õð Ðr   c                 ó   ^ ^• U U4S jnU$ )Nc                 ó(   >^• T" U 5      mUU4S jnU$ )Nc                  ó   >• T" T/U Q70 UD6$ r;   ru   )rZ  re  rø   Údecs     €€r   rk  Ú5_decorate_inline.<locals>.decorate_render.<locals>.goù  s   ø€ Ù�wÐ, Ò,¨Ñ,Ð,r   ru   )rf  rk  rs  rø   rj  s     @€€r   rm  Ú)_decorate_inline.<locals>.decorate_renderö  s   ù€ Ù�‹mˆö	-ð ˆ	r   ru   )rø   rj  rm  s   `` r   Ú_decorate_inlinerv  õ  s   ù€ öð Ðr   c                 óD  • [        XU5      n[        U R                  5       U5      u  pV[        XPR                  40 UD6nUR
                  (       a   U" U40 UD6  gU" U40 UD6  g! [         a0    UR                  U[        R                  " 5       5      nU(       d  e  gf = f)zLlocate the template from the given uri and include it in
the current output.N)	r  r/  rl   Ú_kwargs_for_includer   Úinclude_error_handlerÚ	Exceptionr   Úexception_as)rø   r  rû   r,   r  r=  ÚctxÚresults           r   r  r    s    € ô   ¨kÓ:€HÜ-Ø×)Ñ)Ó+¨Xó�N€Iô ! ¯M©MÑD¸VÑD€FØ×%×%ð	Ù�cÑ$˜VÓ$ñ 	�#Ñ ˜Ó øô ó 	Ø×3Ñ3°C¼×9LÒ9LÓ9NÓOˆFÞØñ ð	ús   Á	A% Á%7BÂBc                 óè  • Uc  g[        XU5      nU S   nUnUR                  b  UR                  nUR                  b  M  U R                  SU05      n[        SUR                  -  UUSS9Ul        UR                  =U R
                  S'   UR
                  S'   [        UR                  S	S5      nUb  U" X65      nU(       a  U$ [        UR                  S
S5      n	U	b  U	" U 5        UR                  U4$ )zycalled by the _inherit method in template modules to set
up the inheritance chain at the start of a template's
execution.Nr   rj   úself:%sF©r  rú   ri   ÚlocalÚ_mako_inheritÚ_mako_generate_namespaces)	r  rï   rf   r  r  r   rŠ   rî   r=  )
rø   r  rû   r  r,  Úihr1  r=  ÚretÚgen_nss
             r   Ú_inherit_fromr‡    s÷   € ð
 �{ØÜ ¨kÓ:€HØ�f‰o€GØ	€BØ
�+‰+Ñ
!Ø�[‰[ˆð �+‰+Ó
!à—‘ &¨" Ó.€JÜ#Ø�H—L‘LÑ ØØØñ	€B„Kð ;=¿+¹+ÐE€G‡M�M�(Ñ˜j×.Ñ.¨wÑ7Ü˜Ÿ™¨¸$Ó?€IØÑÙ˜Ó-ˆÞØˆJä�X—_‘_Ð&AÀ4ÓH€FØÑÙˆwŒØ×Ñ 
Ð+Ð+r   c                 ór  • U R                   R                  nUc-  [        R                  " SU R                   R                  -  5      eUR                  X5      n UR                  U5      $ ! [        R                   a8  n[        R                  " [        [        R                  " 5       5      5      UeS nAff = f)Nz.Template '%s' has no TemplateLookup associated)r   r(   r   ÚTemplateLookupExceptionr  Ú
adjust_urir	  ÚTopLevelLookupExceptionÚstrr   r{  )rø   r  Ú
relativetor(   Úes        r   r  r  5  s§   € Ø×#Ñ#×*Ñ*€FØ�~Ü×0Ò0Ø<Ø×$Ñ$×(Ñ(ñ)ó
ð 	
ð ×
Ñ
˜CÓ
,€CðØ×"Ñ" 3Ó'Ð'øÜ×-Ñ-ó Ü×0Ò0Ü”×#Ò#Ó%Ó&ó
àð	ûðús   ÁA* Á*B6Á>3B1Â1B6c                 ó  • Uc  [        SUR                  -  U USS9nU=U R                  S'   U R                  S'   [        UR                  S5      (       a$  UR                  R                  X5      nU(       a  U$ UR                  U 4$ )Nr  Fr€  r   r�  r‚  )r  r  r   rí   rî   r‚  r=  )rø   r  r,  r…  s       r   r/  r/  E  s‚   € Ø�Ü#Ø˜Ÿ™Ñ$ØØØñ	
ˆð 6=Ð<€G‡M�M�&Ñ˜GŸM™M¨'Ñ2Üˆx�‰ ×0Ñ0Ø�o‰o×+Ñ+¨HÓ>ˆÞØˆJØ×Ñ Ð(Ð(r   c                 óD  • U(       a  [         R                  " 5       nO)[         R                  " U R                  U R                  S9n[	        U40 UD6nXFl        UR                  U 5        [        U UU/UQ70 [        X5      D6  UR                  5       R                  5       $ )zZcreate a Context and return the string
output of the given template and template callable.)ÚencodingÚerrors)r   rC   Úoutput_encodingÚencoding_errorsr   r   r%   Ú_render_contextÚ_kwargs_for_callablerQ   r`  )r  r=  rZ  r   Ú
as_unicoderF   rø   s          r   Ú_renderr˜  U  sŸ   € ö Ü×%Ò%Ó'‰ä×%Ò%Ø×-Ñ-°h×6NÑ6Nñ
ˆô �cÑ"˜TÑ"€GØ%/Ô"Ø×Ñ˜xÔ(äØØØðð 
ò	ô
 ˜yÓ
/òð ×ÑÓ ×)Ñ)Ó+Ð+r   c                 óà   • [         R                  " U 5      nUS   (       a  U$ US   USS  Vs/ sH	  o3c  M  UPM     sn-   n0 nU H  nUS:w  d  M  Xa;   d  M  Xe;  d  M  X   XV'   M!     U$ s  snf )NrÞ   r   rÊ   é   rø   ©r   Úinspect_getargspec)r=  r   Úargspecr  Ú	namedargsr,   Úargs          r   r–  r–  m  sy   € Ü×'Ò'¨	Ó2€Gàˆq‡zØˆð ˜‘
¨°°1©ÓG© AŸa©ÑGÑG€IØ€FÛˆØ�)Õ ¥°Õ0AØ™)ˆF‹Kñ ð €Mùò Hs
   ®A+·A+c                 óÄ   • [         R                  " U 5      nUS   USS  Vs/ sH	  oDc  M  UPM     sn-   nU H  nUS:w  d  M  Xa;   d  M  Xb;  d  M  X   X&'   M!     U$ s  snf )Nr   rÊ   rš  rø   r›  )r=  r   r,   r�  r  rž  rŸ  s          r   rx  rx  |  sf   € Ü×'Ò'¨	Ó2€GØ˜‘
¨°°1©ÓG© AŸa©ÑGÑG€IÛˆØ�)Õ ¥°Õ0AØ™)ˆF‹Kñ ð €Mùò	 Hs
   ¢A«Ac                 ó¶   • SS K Jn  [        XR                  5      (       d  [	        X 5      u  pg[        XgX4S9  g [	        X R                  5      u  pg[        XX4S9  g )Nr   )rZ  r,   )Úmako.templater  Ú
isinstanceÚDefTemplater/  Ú_exec_templateri   )Útmplr=  rø   rZ  r,   r  Úinheritr1  s           r   r•  r•  …  sL   € Ý$ô �d×0Ñ0×1Ñ1ä6°wÓEÑˆÜ�w°ÓEô 7°wÇÁÓLÑˆÜ�y°ÓDr   c                 óD  • UR                   nUb0  UR                  (       d  UR                  (       a   U " U/UQ70 UD6  gU " U/UQ70 UD6  g! [         a"    [	        XA[
        R                  " 5       5         g  [        R                  " 5       S   n[	        XAU5         g= f)zçexecute 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.
Nr   )	r   Úformat_exceptionsÚerror_handlerrz  Ú_render_errorr   r{  ÚsysÚexc_info)r=  rø   rZ  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Á8%Bc                 ó  • U R                   (       aR  U R                  X5      nU(       d9  [        R                  " 5       u  pEnU(       a  U(       a  UR                  U5      eUeg [        R
                  " 5       nUR                  (       a$  [        R                  " 5       /UR                  S S & O9[        R                  " UR                  UR                  5      /UR                  S S & UR                  U5        UR                  XS9  g )N)Úerror)rª  r¬  r­  Úwith_tracebackr   Úhtml_error_templater   r   rC   r   r“  r”  r%   Úrender_context)r  rø   r¯  r}  ÚtpÚvalueÚtbÚerror_templates           r   r«  r«  «  s×   € Ø××Ø×'Ñ'¨Ó7ˆÞÜŸLšL›N‰MˆB�rÞžØ×*Ñ*¨2Ó.Ð.à�ð ô $×7Ò7Ó9ˆØ×)×)Ü(,×(?Ò(?Ó(AÐ'BˆG×!Ñ!¡!Ñ$ô ×'Ò'Ø"×2Ñ2Ø"×2Ñ2óð(ˆG×!Ñ!¡!Ð$ð 	×"Ñ" >Ô2Ø×%Ñ% gÐ%Ò;r   r;   )F)NN)"rr   r<   r   r¬  Úmakor   r   r   r   r7   r   r•   Ú	UNDEFINEDÚSTOP_RENDERINGr¡   r·   rè   rõ   r  rF  r^  r
   ro  rv  r  r‡  r  r/  r˜  r–  rx  r•  r¥  r«  ru   r   r   Ú<module>rº     sà   ðñ,ó Û Û 
å Ý Ý ÷hñ hôV%�$ô %÷8ñ ñ& ‹K€	Ø€÷$ñ $÷N=0ñ =0÷@"ñ "÷~ñ ~ôBY˜	ô Yôx6�iô 6òrò$ò*ò$	ò!ò(,ò@ô )ô ,ò0òòEô,ó.<r   