ó
    ½Rj,#  ã                   ó¬   • S SK Jr  S SKJ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S jrg)é    )Úcontextmanager)Úcopy)z'django.template.context_processors.csrfc                   ó   • \ rS rSrSrSrg)ÚContextPopExceptioné   z,pop() has been called more times than push()© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    ÚCD:\diplom_project\venv\Lib\site-packages\django/template/context.pyr   r      s   † Ù2Úr   r   c                   ó4   ^ • \ rS rSrU 4S jrS rS rSrU =r$ )ÚContextDicté   c                 óh   >• [         TU ]  " U0 UD6  UR                  R                  U 5        Xl        g ©N)ÚsuperÚ__init__ÚdictsÚappendÚcontext)Úselfr   ÚargsÚkwargsÚ	__class__s       €r   r   ÚContextDict.__init__   s,   ø€ Ü‰Ò˜$Ð) &Ò)à�‰×Ñ˜TÔ"Ø�r   c                 ó   • U $ r   r   ©r   s    r   Ú	__enter__ÚContextDict.__enter__   s   € Øˆr   c                 ó8   • U R                   R                  5         g r   )r   Úpop)r   r   r   s      r   Ú__exit__ÚContextDict.__exit__   s   € Ø�‰×ÑÕr   )r   )	r	   r
   r   r   r   r"   r&   r   Ú__classcell__©r   s   @r   r   r      s   ø† õò÷ð r   r   c                   óœ   ^ • \ rS rSrSS jrSS jrU 4S jrS rS rS r	S r
S	 rS
 rS rS rS rSS jrSS jrSS jrS rS rSrU =r$ )ÚBaseContexté   c                 ó&   • U R                  U5        g r   )Ú_reset_dicts)r   Údict_s     r   r   ÚBaseContext.__init__   s   € Ø×Ñ˜%Õ r   c                 ó^   • SSS S.nU/U l         Ub  U R                   R                  U5        g g )NTF)ÚTrueÚFalseÚNone)r   r   )r   ÚvalueÚbuiltinss      r   r.   ÚBaseContext._reset_dicts   s4   € Ø ¨5¸$Ñ?ˆØ�ZˆŒ
ØÑØ�J‰J×Ñ˜eÕ$ð r   c                 óV   >• [        [        5       5      nU R                  S S  Ul        U$ r   )r   r   r   ©r   Ú	duplicater   s     €r   Ú__copy__ÚBaseContext.__copy__%   s#   ø€ Üœ›“Mˆ	ØŸ*™*¡Q˜-ˆ	ŒØÐr   c                 ó,   • [        U R                  5      $ r   )Úreprr   r!   s    r   Ú__repr__ÚBaseContext.__repr__*   s   € Ü�D—J‘JÓÐr   c                 ó,   • [        U R                  5      $ r   ©Úreversedr   r!   s    r   Ú__iter__ÚBaseContext.__iter__-   s   € Ü˜Ÿ
™
Ó#Ð#r   c                 ó¨   • / nU H<  n[        U[        5      (       a  X4R                  SS  -  nM+  UR                  U5        M>     [	        U /UQ70 UD6$ ©Né   )Ú
isinstancer+   r   r   r   )r   r   r   r   Úds        r   ÚpushÚBaseContext.push0   sR   € ØˆÛˆAÜ˜!œ[×)Ñ)ØŸ™  ˜Ñ$’à—‘˜Q–ñ	 ô
 ˜4Ð2 %Ò2¨6Ñ2Ð2r   c                 ót   • [        U R                  5      S:X  a  [        eU R                  R                  5       $ rG   )Úlenr   r   r%   r!   s    r   r%   ÚBaseContext.pop9   s)   € Üˆt�z‰z‹?˜aÓÜ%Ð%Ø�z‰z�~‰~ÓÐr   c                 ó&   • X R                   S   U'   g)z%Set a variable in the current contextéÿÿÿÿN©r   )r   Úkeyr5   s      r   Ú__setitem__ÚBaseContext.__setitem__>   s   € à#�
‰
�2‰�sÒr   c                 ót   • U R                   S   n[        U R                   5       H  nX;   d  M
  Un  O   X#U'   g)zd
Set a variable in one of the higher contexts if it exists there,
otherwise in the current context.
rQ   N)r   rC   )r   rS   r5   r   rJ   s        r   Ú
set_upwardÚBaseContext.set_upwardB   s:   € ð
 —*‘*˜R‘.ˆÜ˜$Ÿ*™*Ö%ˆAØ�xØ�Ùñ &ð �Šr   c                 óf   • [        U R                  5       H  nX;   d  M
  X!   s  $    [        U5      e)zHGet a variable's value, starting at the current context and going upward)rC   r   ÚKeyError)r   rS   rJ   s      r   Ú__getitem__ÚBaseContext.__getitem__N   s-   € ä˜$Ÿ*™*Ö%ˆAØ�xØ‘v’ñ &ô �s‹mÐr   c                 ó$   • U R                   S   U	 g)z*Delete a variable from the current contextrQ   NrR   ©r   rS   s     r   Ú__delitem__ÚBaseContext.__delitem__U   s   € à�J‰J�r‰N˜3Ñr   c                 óB   ^• [        U4S jU R                   5       5      $ )Nc              3   ó.   >#   • U  H
  nTU;   v •  M     g 7fr   r   )Ú.0rJ   rS   s     €r   Ú	<genexpr>Ú+BaseContext.__contains__.<locals>.<genexpr>Z   s   øé € Ð0¢Z �3˜!–8¢Zùs   ƒ)Úanyr   r^   s    `r   Ú__contains__ÚBaseContext.__contains__Y   s   ø€ ÜÔ0 T§Z¢ZÓ0Ó0Ð0r   c                 óT   • [        U R                  5       H  nX;   d  M
  X1   s  $    U$ r   rB   )r   rS   Ú	otherwiserJ   s       r   ÚgetÚBaseContext.get\   s)   € Ü˜$Ÿ*™*Ö%ˆAØ�xØ‘v’ñ &ð Ðr   c                 ó6   •  X   $ ! [          a    X U'    U$ f = fr   )rZ   )r   rS   Údefaults      r   Ú
setdefaultÚBaseContext.setdefaultb   s*   € ð	 Ø‘9ÐøÜó 	 Ø�ŠIØˆð	 ús   ‚ †—c                 ó>   • [        U 5      nUR                  U5        U$ )zc
Return a new context with the same properties, but with only the
values given in 'values' stored.
)r   r.   )r   ÚvaluesÚnew_contexts      r   ÚnewÚBaseContext.newi   s!   € ô
 ˜4“jˆØ× Ñ  Ô(ØÐr   c                 óR   • 0 nU R                    H  nUR                  U5        M     U$ )z&
Return self.dicts as one dictionary.
)r   Úupdate)r   ÚflatrJ   s      r   ÚflattenÚBaseContext.flattenr   s'   € ð ˆØ—”ˆAØ�K‰K˜ŽNñ àˆr   c                 óz   • [        U[        5      (       d  [        $ U R                  5       UR                  5       :H  $ )z>
Compare two contexts by comparing theirs 'dicts' attributes.
)rI   r+   ÚNotImplementedry   )r   Úothers     r   Ú__eq__ÚBaseContext.__eq__{   s.   € ô ˜%¤×-Ñ-Ü!Ð!à�|‰|‹~ §¡£Ñ0Ð0r   rR   r   )r	   r
   r   r   r   r.   r;   r?   rD   rK   r%   rT   rW   r[   r_   rg   rk   ro   rt   ry   r~   r   r(   r)   s   @r   r+   r+      s]   ø† ô!ô%õò
 ò$ò3ò ò
$ò
òò ò1ôôôò÷1ð 1r   r+   c                   óR   ^ • \ rS rSrSrSU 4S jjr\S 5       rU 4S jrS r	Sr
U =r$ )	ÚContexté…   z&A stack container for variable contextc                 ó‚   >• X l         X0l        X@l        SU l        [	        5       U l        S U l        [        TU ]!  U5        g )NÚunknown)	Ú
autoescapeÚuse_l10nÚuse_tzÚtemplate_nameÚRenderContextÚrender_contextÚtemplater   r   )r   r/   r…   r†   r‡   r   s        €r   r   ÚContext.__init__ˆ   s:   ø€ Ø$ŒØ ŒØŒØ&ˆÔÜ+›oˆÔð ˆŒÜ‰Ñ˜Õr   c              #   óx   #   • U R                   b  [        S5      eXl          S v •  S U l         g ! S U l         f = f7f©Nz&Context is already bound to a template)r‹   ÚRuntimeError)r   r‹   s     r   Úbind_templateÚContext.bind_template“   s6   é € à�=‰=Ñ$ÜÐGÓHÐHØ Œð	!Ûà ˆD�Mø˜DˆD�Müs   ‚:¢. ¦:®	7·:c                 óX   >• [         TU ]  5       n[        U R                  5      Ul        U$ r   )r   r;   r   rŠ   r9   s     €r   r;   ÚContext.__copy__�   s)   ø€ Ü‘GÑ$Ó&ˆ	Ü#'¨×(;Ñ(;Ó#<ˆ	Ô ØÐr   c                 ó´   • [        US5      (       d  [        S5      e[        U[        5      (       a  UR                  SS R                  5       n[        X5      $ )z;Push other_dict to the stack of dictionaries in the Contextr[   z6other_dict must be a mapping (dictionary-like) object.rH   N)ÚhasattrÚ	TypeErrorrI   r+   r   r%   r   )r   Ú
other_dicts     r   rw   ÚContext.update¢   sN   € ä�z =×1Ñ1ÜÐTÓUÐUÜ�j¤+×.Ñ.Ø#×)Ñ)¨!¨"Ð-×1Ñ1Ó3ˆJÜ˜4Ó,Ð,r   )r…   rŠ   r‹   rˆ   r†   r‡   )NTNN)r	   r
   r   r   r   r   r   r�   r;   rw   r   r(   r)   s   @r   r�   r�   …   s.   ø† Ù,÷	 ð ñ!ó ð!õ÷
-ð -r   r�   c                   óL   • \ rS rSrSrSrS rS rS
S jrS r	\
SS j5       rS	rg)r‰   é«   aœ  
A stack container for storing Template state.

RenderContext simplifies the implementation of template Nodes by providing a
safe place to store state between invocations of a node's `render` method.

The RenderContext also provides scoping rules that are more sensible for
'template local' variables. The render context stack is pushed before each
template is rendered, creating a fresh scope with nothing in it. Name
resolution fails if a variable is not found at the top of the RequestContext
stack. Thus, variables are local to a specific template and don't affect the
rendering of other templates as they would if they were stored in the normal
template context.
Nc              #   ó>   #   • U R                   S    S h  v•N   g  N7f©NrQ   rR   r!   s    r   rD   ÚRenderContext.__iter__½   s   é € Ø—:‘:˜b‘>×!Ó!ùs   ‚•–c                 ó$   • XR                   S   ;   $ rœ   rR   r^   s     r   rg   ÚRenderContext.__contains__À   s   € Ø—j‘j ‘nÑ$Ð$r   c                 ó>   • U R                   S   R                  X5      $ rœ   )r   rk   )r   rS   rj   s      r   rk   ÚRenderContext.getÃ   s   € Ø�z‰z˜"‰~×!Ñ! #Ó1Ð1r   c                 ó&   • U R                   S   U   $ rœ   rR   r^   s     r   r[   ÚRenderContext.__getitem__Æ   s   € Ø�z‰z˜"‰~˜cÑ"Ð"r   c              #   óê   #   • U R                   nXl         U(       a  U R                  5          S v •  X0l         U(       a  U R                  5         g g ! X0l         U(       a  U R                  5         f f = f7fr   )r‹   rK   r%   )r   r‹   Úisolated_contextÚinitials       r   Ú
push_stateÚRenderContext.push_stateÉ   sV   é € à—-‘-ˆØ ŒÞØ�I‰IŒKð	Ûà#ŒMÞØ—‘•
ð  øð $ŒMÞØ—‘•
ð  üs   ‚*A3­A ±A3Á A0Á0A3)r‹   r   )T)r	   r
   r   r   r   r‹   rD   rg   rk   r[   r   r§   r   r   r   r   r‰   r‰   «   s6   † ñð €Hò"ò%ô2ò#ð ó
ó ó
r   r‰   c                   óZ   ^ • \ rS rSrSr     SU 4S jjr\S 5       rSU 4S jjrSr	U =r
$ )	ÚRequestContexté×   zå
This subclass of template.Context automatically populates itself using
the processors defined in the engine's configuration.
Additional processors can be specified as a list of callables
using the "processors" keyword argument.
c                 óÐ   >• [         TU ]  X$XVS9  Xl        Uc  SO
[        U5      U l        [        U R                  5      U l        U R                  0 5        U R                  0 5        g )N)r†   r‡   r…   r   )	r   r   ÚrequestÚtupleÚ_processorsrN   r   Ú_processors_indexrw   )r   r­   r/   Ú
processorsr†   r‡   r…   r   s          €r   r   ÚRequestContext.__init__ß   sZ   ø€ ô 	‰Ñ˜¸&ÐÑXØŒØ!+Ñ!3™2¼¸zÓ9JˆÔÜ!$ T§Z¡Z£ˆÔð 	�‰�BŒð 	�‰�B�r   c              #   óª  #   • U R                   b  [        S5      eXl         UR                  R                  U R                  -   n0 nU H$  nUR                  U" U R                  5      5        M&     X0R                  U R                  '    S v •  S U l         0 U R                  U R                  '   g ! S U l         0 U R                  U R                  '   f = f7frŽ   )	r‹   r�   ÚengineÚtemplate_context_processorsr¯   rw   r­   r   r°   )r   r‹   r±   ÚupdatesÚ	processors        r   r�   ÚRequestContext.bind_templateô   s±   é € à�=‰=Ñ$ÜÐGÓHÐHà Œà—_‘_×@Ñ@À4×CSÑCSÑSˆ
ØˆÛ#ˆIØ�N‰N™9 T§\¡\Ó2Ö3ñ $à-4�
‰
�4×)Ñ)Ñ*ð	4Ûà ˆDŒMà13ˆD�J‰J�t×-Ñ-Ò.øð !ˆDŒMà13ˆD�J‰J�t×-Ñ-Ò.üs   ‚BCÂ	B. Â!CÂ."CÃCc                 óL   >• [         TU ]  U5      n[        US5      (       a  U?U$ )Nr°   )r   rt   r•   r°   )r   rr   rs   r   s      €r   rt   ÚRequestContext.new  s-   ø€ Ü‘g‘k &Ó)ˆô �;Ð 3×4Ñ4ØÐ-ØÐr   )r¯   r°   r­   r‹   )NNNNTr   )r	   r
   r   r   r   r   r   r�   rt   r   r(   r)   s   @r   rª   rª   ×   s<   ø† ñð ØØØØ÷ð* ñ4ó ð4÷&õ r   rª   Nc                 óè   • U b7  [        U [        5      (       d"  [        SU R                  R                  -  5      eUc  [        U 40 UD6n U $ U n[        U40 UD6n U(       a  U R                  U5        U $ )zL
Create a suitable Context from a plain dict and optionally an HttpRequest.
z&context must be a dict rather than %s.)rI   Údictr–   r   r	   r�   rª   rK   )r   r­   r   Úoriginal_contexts       r   Úmake_contextr¾     s€   € ð Ñ¤:¨g´t×#<Ñ#<ÜØ4°w×7HÑ7H×7QÑ7QÑQó
ð 	
ð �Ü˜'Ñ, VÑ,ˆð €Nð	 #ÐÜ  Ñ3¨FÑ3ˆÞØ�L‰LÐ)Ô*Ø€Nr   r   )Ú
contextlibr   r   Ú_builtin_context_processorsÚ	Exceptionr   r¼   r   r+   r�   r‰   rª   r¾   r   r   r   Ú<module>rÂ      se   ðÝ %Ý ð KÐ ô	˜)ô 	ô
�$ô ÷g1ñ g1ôT#-ˆkô #-ôL)�Kô )ôX7�Wô 7õtr   