관리-도구
편집 파일: bottle.cpython-311.pyc
� �܋fG � �j � d dl mZ d dlmZ d dlmZ d dlmZmZm Z m Z d dlmZm Z d dlmZ d dlmZ d dlmZ er0d d lmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZmZmZ d dlmZmZ d dlm Z m!Z!m"Z#m$Z$m%Z& n# e'$ r e d� � �w xY wdZ( G d� de� � Z) G d� de� � Z*d� Z+d� Z,dS )� )�absolute_import)�Hub)�SOURCE_FOR_STYLE)�capture_internal_exceptions�event_from_exception� parse_version�transaction_from_function)�Integration�DidNotEnable)�SentryWsgiMiddleware)�RequestExtractor)� TYPE_CHECKING)�_ScopedResponse)�Any)�Dict)�Callable)�Optional)� FileUpload� FormsDict�LocalRequest)�EventProcessor�Event)�Bottle�Route�request�HTTPResponse�__version__zBottle not installed)�endpoint�urlc �4 � e Zd ZdZdZdd�Zed� � � ZdS )�BottleIntegration�bottle� r c �\ � |t vrt d|�dt �d�� � �|| _ d S )Nz%Invalid value for transaction_style: z (must be in �))�TRANSACTION_STYLE_VALUES� ValueError�transaction_style)�selfr( s �U/opt/cloudlinux/venv/lib64/python3.11/site-packages/sentry_sdk/integrations/bottle.py�__init__zBottleIntegration.__init__/ sL � � �$<�<�<��*�$�$�$�&>�&>�&>�@�� � � "3����� c �^ ���� t t � � } | �'t d� t � � � � �| dk rt d� � �t j ��fd�}|t _ t j ��fd�}|t _ t j ��fd�}|t _ d S )NzUnparsable Bottle version: {})r � zBottle 0.12 or newer required.c � �� � t j }|� t � � }|� �� ||� � S t �� fd�� � ||� � S )Nc � �� ��g| �R i |��S �N� )�a�kw�old_appr) s ��r* �<lambda>zOBottleIntegration.setup_once.<locals>.sentry_patched_wsgi_app.<locals>.<lambda>P s! �� ����9P��9P�9P�9P�R�9P�9P� r, )r �current�get_integrationr! r )r) �environ�start_response�hub�integrationr5 s ` �r* �sentry_patched_wsgi_appz=BottleIntegration.setup_once.<locals>.sentry_patched_wsgi_appH sj ��� � �+�C��-�-�.?�@�@�K��"��w�t�W�n�=�=�=�Q�'�(P�(P�(P�(P�(P�Q�Q���� � r, c � �� t j }|� t � � }|� �| |� � S |� � � }|5 | }|� � � 5 }d|_ |� t |t |� � � � d d d � � n# 1 swxY w Y �| |� � }d d d � � n# 1 swxY w Y |S )Nr"