관리-도구
편집 파일: transactions.cpython-311.pyc
� �܋fN � � � d Z ddlmZ ddlZddlmZ er0ddlmZ ddlm Z ddlm Z ddlmZ dd lmZ dd lm Z ddlmZ ddlmZ dd lmZ n# e$ r dd lmZ Y nw xY wd� Z G d� de� � Z e� � ZdS )zZ Copied from raven-python. Used for `DjangoIntegration(transaction_fron="raven_legacy")`. � )�absolute_importN)� TYPE_CHECKING)�URLResolver)�Dict)�List)�Optional)� URLPattern)�Tuple)�Union)�Pattern)�get_resolverc �P � | j }n# t $ r | j j }Y nw xY w|S )z5Utility method for django's deprecated resolver.regex)�regex�AttributeError�pattern)�resolver_or_patternr s �|/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/sentry_sdk/integrations/django/transactions.py� get_regexr s@ � �2�#�)����� 2� 2� 2�#�+�1����2�����Ls � �#�#c �� � e Zd Z ej d� � Z ej d� � Z ej d� � Z ej d� � Z ej d� � Z i Z d� Zd d�Z d d �Z dS )� RavenResolverz\(\?\:([^\)]+)\)z\(\?P<(\w+)>.*\)z \([^\)]+\)z\[([^\]]+)\|([^\]]+)\]z([A-Z]+)([a-z])c � � | j � d� |� � }| j � d� |� � }| j � d|� � }| j � d� |� � }|� dd� � � dd� � � dd� � � d d� � � d d� � � dd� � � d d� � }|S )z� Clean up urlpattern regexes into something readable by humans: From: > "^(?P<sport_slug>\w+)/athletes/(?P<athlete_slug>\w+)/$" To: > "{sport_slug}/athletes/{athlete_slug}/" c �2 � d| � d� � z S )Nz%s� ��group��ms r �<lambda>z)RavenResolver._simplify.<locals>.<lambda>? s � �D�1�7�7�1�:�:�<M� � c �2 � d| � d� � z S )Nz{%s}r r r s r r z)RavenResolver._simplify.<locals>.<lambda>B s � ��!�'�'�!�*�*�9L� r z{var}c �, � | � d� � S )Nr r r s r r z)RavenResolver._simplify.<locals>.<lambda>H s � �1�7�7�1�:�:� r �^� �$�?z\Az\Zz//�/�\)�_optional_group_matcher�sub�_named_group_matcher�_non_named_group_matcher�_either_option_matcher�replace)�selfr �results r � _simplifyzRavenResolver._simplify0 s� � � �-�1�1�2M�2M�w�W�W�� �*�.�.�/L�/L�f�U�U�� �.�2�2�7�F�C�C�� �,�0�0�1E�1E�v�N�N�� �N�N�3��#�#� �W�S�"� � � �W�S�"� � � �W�U�B� � � �W�U�B� � � �W�T�3� � � �W�T�2� � � � � r Nc �t � � t |� � � |� � }|sd S |�|g}n ||vr||gz }||� � � d � }|j D ]�}|j s� � |||� � }|r|c S �'t |� � � |� � s�J � j | c S # t $ r Y nw xY wd� � fd�|D � � � � }|� � t |� � j � � z } | � d� � sd| z } | � j |<