관리-도구
편집 파일: transactions.cpython-38.pyc
U ��\# � @ sl d Z ddlmZ ddlZzddlm Z W n ek rH ddlm Z Y nX dd� ZG dd� de�Ze� ZdS ) zZ Copied from raven-python. Used for `DjangoIntegration(transaction_fron="raven_legacy")`. � )�absolute_importN)�get_resolverc C s, z | j }W n tk r& | jj }Y nX |S )z5Utility method for django's deprecated resolver.regex)�regex�AttributeError�pattern)Zresolver_or_patternr � r �\/opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/django/transactions.py� get_regex s r c @ s^ e Zd Ze�d�Ze�d�Ze�d�Ze�d�Ze�d�Z i Z dd� Zd d d �Zddd�Z dS )� RavenResolverz\(\?\:([^\)]+)\)z\(\?P<(\w+)>[^\)]+\)z \([^\)]+\)z\[([^\]]+)\|([^\]]+)\]z([A-Z]+)([a-z])c C st | j �dd� |�}| j�dd� |�}| j�d|�}| j�dd� |�}|�dd��dd��d d��d d��dd�}|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 S s d| � d� S )Nz%s� ��group��mr r r �<lambda>= � z)RavenResolver._simplify.<locals>.<lambda>c S s d| � d� S )Nz{%s}r r r r r r r @ r z{var}c S s | � d�S )Nr r r r r r r F r �^� �$�?z//�/�\)�_optional_group_matcher�sub�_named_group_matcher�_non_named_group_matcher�_either_option_matcher�replace)�selfr �resultr r r � _simplify. s&