[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.144.242.149: ~ $
U

��\�2�@sddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZmZd	d
�Zed�Zdadd
�ZGdd�de �Z!dd�Z"Gdd�de#�Z$Gdd�de �Z%Gdd�de �Z&Gdd�de	e$��Z'e'�Z(e�)e(�dS)�N)�datetime)�contextmanager)�warn)�with_metaclass��Scope)�Client)�exc_info_from_error�event_from_exception�logger�
ContextVarcCs|S�N�)�xrr�/hub.py�overload srZsentry_current_hubcCstjj}|sdS|jdS)NFZsend_default_pii)�Hub�current�client�options)rrrr�_should_send_default_pii(src@s$eZdZdd�Zdd�Zdd�ZdS)�
_InitGuardcCs
||_dSr
)�_client)�selfrrrr�__init__1sz_InitGuard.__init__cCs|Sr
r�rrrr�	__enter__4sz_InitGuard.__enter__cCs|j}|dk	r|��dSr
)r�close)r�exc_type�	exc_value�tb�crrr�__exit__7sz_InitGuard.__exit__N��__name__�
__module__�__qualname__rrr"rrrrr0srcOs4t||�}tj�|�t|�}|dk	r0t�|�a|S)zsInitializes the SDK and optionally integrations.

    This takes the same arguments as the client constructor.
    N)rrr�bind_clientr�weakref�ref�_initial_client)�args�kwargsr�rvrrr�init=s

r.c@s$eZdZedd��Zedd��ZdS)�HubMetacCs(t�d�}|dkr$tt�}t�|�|S)z(Returns the current instance of the hub.N)�_local�getr�
GLOBAL_HUB�set�rr-rrrrLs


zHubMeta.currentcCstS)z%Returns the main instance of the hub.)r2rrrr�mainVszHubMeta.mainN)r$r%r&�propertyrr5rrrrr/Ks
	r/c@seZdZdd�Zdd�ZdS)�_HubManagercCstj|_t�|�dSr
)rr�_oldr0r3�r�hubrrrr]sz_HubManager.__init__cCst�|j�dSr
)r0r3r8)rrrr rrrr"asz_HubManager.__exit__N)r$r%r&rr"rrrrr7\sr7c@s$eZdZdd�Zdd�Zdd�ZdS)�
_ScopeManagercCs"||_t|j�|_|jd|_dS�N���)�_hub�len�_stack�
_original_len�_layerr9rrrrfsz_ScopeManager.__init__cCs|jd}|dk	st�|S)N�)rB�AssertionError)r�scoperrrrks
z_ScopeManager.__enter__cCs�t|jj�}||jkr,t�d|j|�dS||jkrXt�d||j|jj|jd��|jj|jd}|jj|jdd�=|d|jdkr�t�d|d|jd�n |d|jdkr�d}t�|�dS)Nz1Scope popped too soon. Popped %s scopes too many.zLeaked %s scopes: %srCz2Wrong scope found. Meant to pop %s, but popped %s.rz�init() called inside of pushed scope. This might be entirely legitimate but usually occurs when initializing the SDK inside a request handler or task/job function. Try to initialize the SDK as early as possible instead.)r?r>r@rAr�error�warningrB)rrrr Zcurrent_lenZlayerrGrrrr"qs2
�
���z_ScopeManager.__exit__Nr#rrrrr;esr;c@s�eZdZdZdZd)dd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
d��Zdd�Zdd�Z
d*dd�Zd+dd�Zd,dd�Zdd�Zd-dd�Zedd��Zedd��Zd.d d�ZeZd!d"�Zed#d$��Zed%d$��Zd/d&d$�Zd0d'd(�ZdS)1rz�The hub wraps the concurrency management of the SDK.  Each thread has
    its own hub but the hub might transfer with the flow of execution if
    context vars are available.

    If the hub is used with a with statement it's temporarily activated.
    NcCs^t|t�r0|}|jd\}}|dkr4t�|�}n|}|dkrBt�}||fg|_d|_g|_dSr<)�
isinstancerr@�copyr�_last_event_id�	_old_hubs)rZ
client_or_hubrEr:rZother_scoperrrr�s
zHub.__init__cCs|j�tj�t�|�|Sr
)rK�appendrrr0r3rrrrr�s
z
Hub.__enter__cCs|j��}t�|�dSr
)rK�popr0r3)rrrr �oldrrrr"�s
zHub.__exit__c
Cs"|�|�W5QR�SQRXdS)z~Runs a callback in the context of the hub.  Alternatively the
        with statement can be used on the hub directly.
        Nr�r�callbackrrr�run�szHub.runcCs�t|t�r|}n|jdk	r"|j}ntd��|jdd}|dk	rX|j�|�}|dk	rX|St}|dk	rj|�}|dk	r�||k	r�|j�|�dk	r�d|f}tt	|�dd�t
�|�dS)aReturns the integration for this hub by name or class.  If there
        is no client bound or the client does not have that integration
        then `None` is returned.

        If the return value is not `None` the hub is guaranteed to have a
        client attached.
        NzIntegration has no namer=rz�Integration %r attempted to run but it was only enabled on init() but not the client that was bound to the current flow.  Earlier versions of the SDK would consider these integrations enabled but this is no longer the case.�)�
stacklevel)rH�strZ
identifier�
ValueErrorr@Zintegrationsr1r*r�WarningrrG)rZ
name_or_classZintegration_namerr-Zinitial_clientrGrrr�get_integration�s2	

�����zHub.get_integrationcCs|jddS)z&Returns the current client on the hub.r=r�r@rrrrr�sz
Hub.clientcCs|jS)zReturns the last event ID.)rJrrrr�
last_event_id�szHub.last_event_idcCs |jd}||df|jd<dS)zBinds a new client to the hub.r=rCNrX)r�new�toprrrr'�s
zHub.bind_clientcCs:|jd\}}|dk	r6|�|||�}|dk	r2||_|SdS)akCaptures an event.  The return value is the ID of the event.

        The event is a dictionary following the Sentry v7/v8 protocol
        specification.  Optionally an event hint dict can be passed that
        is used by processors to extract additional information from it.
        Typically the event hint object would contain exception information.
        r=N)r@�
capture_eventrJ)r�event�hintrrEr-rrrr\�s	zHub.capture_eventcCs*|jdkrdS|dkrd}|�||d��S)zyCaptures a message.  The message is just a string.  If no level
        is provided the default level is `info`.
        N�info)�message�level)rr\)rr`rarrr�capture_messages

zHub.capture_messagecCsv|j}|dkrdS|dkr$t��}nt|�}t||jd�\}}z|j||d�WStk
rp|�t���YnXdS)z�Captures an exception.

        The argument passed can be `None` in which case the last exception
        will be reported, otherwise an exception object or an `exc_info`
        tuple.
        N)Zclient_options)r^)	r�sys�exc_infor	r
rr\�	Exception�_capture_internal_exception)rrFrrdr]r^rrr�capture_exceptions
zHub.capture_exceptioncCstjd|d�dS)zNCapture an exception that is likely caused by a bug in the SDK
        itself.zInternal error in sentry_sdk)rdN)rrF)rrdrrrrf1szHub._capture_internal_exceptioncKs�|jd\}}|dkr$t�d�dSt|p,d�}|�|�|sBdSt|pJd�}|�d�dkrht��|d<|�d�dkr~d|d<|}|jddk	r�|jd||�}|dk	r�|j	�
|�nt�d	|�|jd
}t|j	�|kr�|j	��q�dS)z�Adds a breadcrumb.  The breadcrumbs are a dictionary with the
        data as the sentry v7/v8 protocol expects.  `hint` is an optional
        value that can be used by `before_breadcrumb` to customize the
        breadcrumbs that are emitted.
        r=Nz*Dropped breadcrumb because no client boundrZ	timestamp�type�defaultZbefore_breadcrumbz)before breadcrumb dropped breadcrumb (%s)�max_breadcrumbs)
r@rr_�dict�updater1rZutcnowrZ_breadcrumbsrLr?�popleft)rZcrumbr^r,rrEZoriginal_crumbrjrrr�add_breadcrumb6s,


zHub.add_breadcrumbcCsdSr
rrrrr�
push_scope[szHub.push_scopecCsdSr
rrOrrrro`sc	CsX|dk	r(|���}||�W5QRXdS|jd\}}|t�|�f}|j�|�t|�S)z�Pushes a new layer on the scope stack. Returns a context manager
        that should be used to pop the scope again.  Alternatively a callback
        can be provided that is executed in the context of the scope.
        Nr=)ror@rIrLr;)rrPrErZ	new_layerrrrroes
cCs|j��}|jstd��|S)zaPops a scope layer from the stack. Try to use the context manager
        `push_scope()` instead.z"stack must have at least one layer)r@rMrDr4rrr�pop_scope_unsafexs
zHub.pop_scope_unsafecCsdSr
rrrrr�configure_scopeszHub.configure_scopecCsdSr
rrOrrrrq�scsB|jd\��|dk	r*�dk	r&|��dSt��fdd��}|�S)zReconfigures the scope.r=Nc3s�dk	r�Vnt�VdSr
rr�rrErr�inner�sz"Hub.configure_scope.<locals>.inner)r@r)rrPrsrrrrrq�scCs(|jd\}}|dk	r$|j||d�SdS)zAlias for self.client.flushr=N)�timeoutrP)r@�flush)rrtrPrrErrrru�sz	Hub.flush)NN)N)N)N)NN)N)N)NN)r$r%r&�__doc__r@rrr"rQrWr6rrYr'r\rbrgrfrnrrorErprqrurrrrr�s:

)




%





r)*rcrIr(r�
contextlibr�warningsrZsentry_sdk._compatrZsentry_sdk.scoperZsentry_sdk.clientrZsentry_sdk.utilsr	r
rrZUnionZAnyZOptionalZDictZTupleZList�CallablerZContextManagerZIntegrationr0r*r�objectrr.rhr/r7r;rr2r3rrrr�<module>s.
	.

Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 1.43 KB 0644
__init__.cpython-38.pyc File 1.43 KB 0644
_compat.cpython-38.opt-1.pyc File 2.43 KB 0644
_compat.cpython-38.pyc File 2.46 KB 0644
api.cpython-38.opt-1.pyc File 2.83 KB 0644
api.cpython-38.pyc File 2.83 KB 0644
client.cpython-38.opt-1.pyc File 6.07 KB 0644
client.cpython-38.pyc File 6.07 KB 0644
consts.cpython-38.opt-1.pyc File 912 B 0644
consts.cpython-38.pyc File 912 B 0644
debug.cpython-38.opt-1.pyc File 1.52 KB 0644
debug.cpython-38.pyc File 1.52 KB 0644
hub.cpython-38.opt-1.pyc File 11.45 KB 0644
hub.cpython-38.pyc File 11.53 KB 0644
scope.cpython-38.opt-1.pyc File 6.3 KB 0644
scope.cpython-38.pyc File 6.3 KB 0644
transport.cpython-38.opt-1.pyc File 5.6 KB 0644
transport.cpython-38.pyc File 5.6 KB 0644
utils.cpython-38.opt-1.pyc File 20.28 KB 0644
utils.cpython-38.pyc File 20.39 KB 0644
worker.cpython-38.opt-1.pyc File 3.17 KB 0644
worker.cpython-38.pyc File 3.17 KB 0644