ó
    ychÈ  ã                   ó`   • S SK r S SKrS SKrS SKrS SKJrJrJr   " S S5      r " S S5      r	g)é    N)ÚAnyÚDictÚUnionc                   ó^   ^ • \ rS rSrSrSS jrS rS\S\SS4U 4S	 jjr	S\SS4S
 jr
SrU =r$ )Ú_CVaré   zStorage utility for Local.ÚreturnNc                 ó:   • [         R                  " S5      U l        g )Nzasgiref.local)ÚcontextvarsÚ
ContextVarÚ_data©Úselfs    ÚV/var/www/djangovue.mamus.xyz/django/venv/lib/python3.13/site-packages/asgiref/local.pyÚ__init__Ú_CVar.__init__   s   € Ü?J×?UÒ?UØó@
ˆ�
ó    c                 ó‚   • U R                   R                  0 5      n X!   $ ! [         a    [        U < SU< 35      ef = f©Nz object has no attribute )r   ÚgetÚKeyErrorÚAttributeError©r   ÚkeyÚstorage_objects      r   Ú__getattr__Ú_CVar.__getattr__   sK   € ØŸ™Ÿ™¨Ó+ˆð	NØ!Ñ&Ð&øÜó 	NÜ  D¡8Ð+DÀSÁGÐ!LÓMÐMð	Nús   �! ¡>r   Úvaluec                 ó¤   >• US:X  a  [         TU ]  X5      $ U R                  R                  0 5      nX#U'   U R                  R	                  U5        g )Nr   )ÚsuperÚ__setattr__r   r   Úset)r   r   r   r   Ú	__class__s       €r   r!   Ú_CVar.__setattr__   sD   ø€ Ø�'‹>Ü‘7Ñ& sÓ2Ð2àŸ™Ÿ™¨Ó+ˆØ#�sÑØ�
‰
�‰�~Õ&r   c                 ó¢   • U R                   R                  0 5      nX;   a  X!	 U R                   R                  U5        g [        U < SU< 35      er   )r   r   r"   r   r   s      r   Ú__delattr__Ú_CVar.__delattr__   sG   € ØŸ™Ÿ™¨Ó+ˆØÓ ØÐ#Ø�J‰J�N‰N˜>Õ*ä  D¡8Ð+DÀSÁGÐ!LÓMÐMr   )r   )r	   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ústrr   r!   r&   Ú__static_attributes__Ú__classcell__©r#   s   @r   r   r      sG   ø† Ù$ô
ò
Nð'˜sð '¨3ð '°4÷ 'ðN˜sð N t÷ Nò Nr   r   c                   ór   ^ • \ rS rSrSrSS\SS4S jjr\R                  S 5       r	S r
U 4S	 jrS
 rSrU =r$ )ÚLocalé(   a¶  Local storage for async tasks.

This is a namespace object (similar to `threading.local`) where data is
also local to the current async task (if there is one).

In async threads, local means in the same sense as the `contextvars`
module - i.e. a value set in an async frame will be visible:

- to other async code `await`-ed from this frame.
- to tasks spawned using `asyncio` utilities (`create_task`, `wait_for`,
  `gather` and probably others).
- to code scheduled in a sync thread using `sync_to_async`

In "sync" threads (a thread with no async event loop running), the
data is thread-local, but additionally shared with async code executed
via the `async_to_sync` utility, which schedules async code in a new thread
and copies context across to that thread.

If `thread_critical` is True, then the local will only be visible per-thread,
behaving exactly like `threading.local` if the thread is sync, and as
`contextvars` if the thread is async. This allows genuinely thread-sensitive
code (such as DB handles) to be kept stricly to their initial thread and
disable the sharing across `sync_to_async` and `async_to_sync` wrapped calls.

Unlike plain `contextvars` objects, this utility is threadsafe.
Úthread_criticalr	   Nc                 óª   • Xl         [        R                  " 5       U l        U   U(       a  [        R                  " 5       U l        g [        5       U l        g ©N)Ú_thread_criticalÚ	threadingÚRLockÚ_thread_lockÚlocalÚ_storager   )r   r4   s     r   r   ÚLocal.__init__D   s6   € Ø /ÔÜ%ŸOšOÓ-ˆÔáæä%ŸOšOÓ-ˆD�Mô "›GˆD�Mr   c              #   ó˜  #   • U R                   (       ac   [        R                  " 5         [        U R                  S5      (       d  [        5       U R                  l        U R                  R                  v •  g U R                     U R                  v •  S S S 5        g ! [         a    U R                  v •   g f = f! , (       d  f       g = f7f)NÚcvar)	r7   ÚasyncioÚget_running_loopÚhasattrr<   r   r?   ÚRuntimeErrorr:   r   s    r   Ú_lock_storageÚLocal._lock_storageQ   s˜   é € ð × × ð)ô ×(Ò(Ô*ô ˜tŸ}™}¨f×5Ñ5Ü).«�D—M‘MÔ&ð
 —m‘m×(Ñ(Ó(ð ×"Ó"Ø—m‘mÒ#÷ #Ð"øô/  ó $ð
 —m‘mÔ#ð$ú÷. #Õ"üs@   ‚C
•B ªAC
ÂB9Â	C
ÂB6Â3C
Â5B6Â6C
Â9
CÃC
c                 ón   • U R                  5        n[        X!5      sS S S 5        $ ! , (       d  f       g = fr6   )rD   Úgetattr©r   r   Ústorages      r   r   ÚLocal.__getattr__t   s$   € Ø×ÑÔ! WÜ˜7Ó(÷ "×!×!ús   ‘&¦
4c                 óœ   >• US;   a  [         TU ]  X5      $ U R                  5        n[        X1U5        S S S 5        g ! , (       d  f       g = f)N)Ú_localr<   r7   r:   )r    r!   rD   Úsetattr)r   r   r   rI   r#   s       €r   r!   ÚLocal.__setattr__x   s@   ø€ ØÐLÓLÜ‘7Ñ& sÓ2Ð2Ø×ÑÔ! WÜ�G %Ô(÷ "×!Ö!ús	   §=½
Ac                 ón   • U R                  5        n[        X!5        S S S 5        g ! , (       d  f       g = fr6   )rD   ÚdelattrrH   s      r   r&   ÚLocal.__delattr__~   s$   € Ø×ÑÔ! WÜ�GÔ!÷ "×!Ö!ús   ‘&¦
4)r<   r7   r:   )F)r(   r)   r*   r+   r,   Úboolr   Ú
contextlibÚcontextmanagerrD   r   r!   r&   r.   r/   r0   s   @r   r2   r2   (   sJ   ø† ññ6$¨ð $¸õ $ð ×Ññ $ó ð $òD)õ)÷"ð "r   r2   )
r@   rS   r   r8   Útypingr   r   r   r   r2   © r   r   Ú<module>rW      s0   ðÛ Û Û Û ß #Ñ #÷Nñ N÷@X"ò X"r   