Sindbad~EG File Manager
�
'ٜg�W � �� � d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dl m
Z
d dl mZ d dlmZ ddl
mZ ej rd d lmZ d d
lmZ d dlmZ ej( d� Z ej( d
ej, dej. f �� Zdd�Z G d� d� Z G d� dej6 e � Z G d� d� Z G d� d� Z G d� de� Zd d�Z d!d�Z! G d� dej6 e � Z"y)"� )�annotationsN)�
ContextVar��partial)�update_wrapper)�
attrgetter� )�ClosingIterator)�
StartResponse)�WSGIApplication)�WSGIEnvironment�T�F.)�boundc �$ � | j � y)z�Release the data for the current context in a :class:`Local` or
:class:`LocalStack` without using a :class:`LocalManager`.
This should not be needed for modern use cases, and may be removed
in the future.
.. versionadded:: 0.6.1
N)�__release_local__)�locals �9/usr/local/lib/python3.12/site-packages/werkzeug/local.py�
release_localr s � �
���� c �^ � e Zd ZdZdZdd
d�Zdd�Zdd� dd�Zdd�Zdd �Z dd
�Z
dd�Zy)�Localaq Create a namespace of context-local data. This wraps a
:class:`ContextVar` containing a :class:`dict` value.
This may incur a performance penalty compared to using individual
context vars, as it has to copy data to avoid mutating the dict
between nested contexts.
:param context_var: The :class:`~contextvars.ContextVar` to use as
storage for this local. If not given, one will be created.
Context vars not created at the global scope may interfere with
garbage collection.
.. versionchanged:: 2.0
Uses ``ContextVar`` instead of a custom storage implementation.
)� __storageNc �f � |�t dt | � � d�� }t j | d|� y )Nzwerkzeug.Local<� >.storage�_Local__storage)r �id�object�__setattr__��self�context_vars r �__init__zLocal.__init__6 s4 � ���
%��r�$�x�j� �%J�K�K����4�!2�K�@r c �f � t | j j i � j � � S �N)�iterr �get�items�r! s r �__iter__zLocal.__iter__@ s% � ��D�N�N�&�&�r�*�0�0�2�3�3r ��unbound_messagec � � t | ||�� S )z�Create a :class:`LocalProxy` that access an attribute on this
local namespace.
:param name: Proxy this attribute.
:param unbound_message: The error message that the proxy will
show if the attribute isn't set.
r+ ��
LocalProxy�r! �namer, s r �__call__zLocal.__call__C s � � �$��o�F�Fr c �: � | j j i � y r% )r �setr) s r r zLocal.__release_local__O s � ������2�r c �` � | j j i � }||v r|| S t |� �r% )r r'