[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.118.138.113: ~ $


��\�2�@sjddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZmZd	d
�Zed�Zdadd
�ZGdd�de�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de	e��Ze�Zej e�dS)�N)�datetime)�contextmanager)�warn)�with_metaclass)�Scope)�Client)�exc_info_from_error�event_from_exception�logger�
ContextVarcCs|S)N�)�xrr�/hub.py�overload srZsentry_current_hubcCs!tjj}|sdS|jdS)NFZsend_default_pii)�Hub�current�client�options)rrrr�_should_send_default_pii(src@s4eZdZdd�Zdd�Zdd�ZdS)�
_InitGuardcCs
||_dS)N)�_client)�selfrrrr�__init__1sz_InitGuard.__init__cCs|S)Nr)rrrr�	__enter__4sz_InitGuard.__enter__cCs#|j}|dk	r|j�dS)N)r�close)r�exc_type�	exc_value�tb�crrr�__exit__7s	z_InitGuard.__exit__N)�__name__�
__module__�__qualname__rrrrrrrr0srcOsJt||�}tjj|�t|�}|dk	rFtj|�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�rvrrr�init=sr*c@s4eZdZedd��Zedd��ZdS)�HubMetacCs8tjd�}|dkr4tt�}tj|�|S)z(Returns the current instance of the hub.N)�_local�getr�
GLOBAL_HUB�set)rr)rrrrLs

zHubMeta.currentcCstS)z%Returns the main instance of the hub.)r.)rrrr�mainVszHubMeta.mainN)r r!r"�propertyrr0rrrrr+Ks
r+c@s(eZdZdd�Zdd�ZdS)�_HubManagercCstj|_tj|�dS)N)rr�_oldr,r/)r�hubrrrr]sz_HubManager.__init__cCstj|j�dS)N)r,r/r3)rrrrrrrrasz_HubManager.__exit__N)r r!r"rrrrrrr2\sr2c@s4eZdZdd�Zdd�Zdd�ZdS)�
_ScopeManagercCs/||_t|j�|_|jd|_dS)N����)�_hub�len�_stack�
_original_len�_layer)rr4rrrrfs	z_ScopeManager.__init__cCs#|jd}|dk	st�|S)Nr6)r<�AssertionError)r�scoperrrrks
z_ScopeManager.__enter__cCst|jj�}||jkr<tjd|j|�dS||jkrxtjd||j|jj|jd��|jj|jd}|jj|jdd�=|d|jdkr�tjd|d|jd�n*|d|jdkrd}tj|�dS)Nz1Scope popped too soon. Popped %s scopes too many.zLeaked %s scopes: %sr6z2Wrong 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.)r9r8r:r;r
�error�warningr<)rrrrZcurrent_lenZlayerr@rrrrqs*
z_ScopeManager.__exit__N)r r!r"rrrrrrrr5esr5c@s]eZdZdZdZdddd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
d��Zdd�Zdd�Z
ddd�Zddd�Zddd�Zdd�Zdddd�Zedd��Zedd��Zdd d�ZeZd!d"�Zed#d$��Zed%d$��Zdd&d$�Zddd'd(�ZdS))rz�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�rF|}|jd\}}|dkrLtj|�}n|}|dkrat�}||fg|_d|_g|_dS)Nr6r7)�
isinstancerr:�copyr�_last_event_id�	_old_hubs)rZ
client_or_hubr>r4rZother_scoperrrr�s		zHub.__init__cCs$|jjtj�tj|�|S)N)rD�appendrrr,r/)rrrrr�s
z
Hub.__enter__cCs |jj�}tj|�dS)N)rD�popr,r/)rrrr�oldrrrr�szHub.__exit__c	Cs|�|�SWdQRXdS)z~Runs a callback in the context of the hub.  Alternatively the
        with statement can be used on the hub directly.
        Nr)r�callbackrrr�run�szHub.runcCs�t|t�r|}n'|jdk	r3|j}ntd��|jdd}|dk	r~|jj|�}|dk	r~|St}|dk	r�|�}|dk	r�||k	r�|jj|�dk	r�d|f}tt	|�dd�t
j|�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 namer6rz�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�r7)rA�strZ
identifier�
ValueErrorr:Zintegrationsr-r&r�Warningr
r@)rZ
name_or_classZintegration_namerr)Zinitial_clientr@rrr�get_integration�s(			
zHub.get_integrationcCs|jddS)z&Returns the current client on the hub.r6rr7)r:)rrrrr�sz
Hub.clientcCs|jS)zReturns the last event ID.)rC)rrrr�
last_event_id�szHub.last_event_idcCs(|jd}||df|jd<dS)zBinds a new client to the hub.r6Nr7r7)r:)r�new�toprrrr#�s
zHub.bind_clientcCsQ|jd\}}|dk	rM|j|||�}|dk	rI||_|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.
        r6Nr7)r:�
capture_eventrC)r�event�hintrr>r)rrrrS�s		zHub.capture_eventcCs>|jdkrdS|dkr%d}|jd|d|i�S)zyCaptures a message.  The message is just a string.  If no level
        is provided the default level is `info`.
        N�info�message�level)rrS)rrWrXrrr�capture_messages
zHub.capture_messagecCs�|j}|dkrdS|dkr4tj�}nt|�}t|d|j�\}}y|j|d|�SWn%tk
r�|jtj��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.
        NZclient_optionsrU)	r�sys�exc_inforr	rrS�	Exception�_capture_internal_exception)rr?rr[rTrUrrr�capture_exceptions	
zHub.capture_exceptioncCstjdd|�dS)zNCapture an exception that is likely caused by a bug in the SDK
        itself.zInternal error in sentry_sdkr[N)r
r?)rr[rrrr]1szHub._capture_internal_exceptioncKsG|jd
\}}|dkr0tjd�dSt|p<f�}|j|�|sYdSt|pef�}|jd�dkr�tj�|d<|jd�dkr�d|d<|}|jddk	r�|jd||�}|dk	r�|j	j
|�ntjd|�|jd	}x&t|j	�|krB|j	j�qWdS)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.
        r6Nz*Dropped breadcrumb because no client boundZ	timestamp�type�defaultZbefore_breadcrumbz)before breadcrumb dropped breadcrumb (%s)�max_breadcrumbsr7)
r:r
rV�dict�updater-rZutcnowrZ_breadcrumbsrEr9�popleft)rZcrumbrUr(rr>Zoriginal_crumbrarrr�add_breadcrumb6s,



zHub.add_breadcrumbcCsdS)Nr)rrrr�
push_scope[szHub.push_scopecCsdS)Nr)rrHrrrrf`sc
Csr|dk	r0|j��}||�WdQRXdS|jd\}}|tj|�f}|jj|�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.
        Nr6r7)rfr:rBrEr5)rrHr>rZ	new_layerrrrrfescCs(|jj�}|js$td��|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:rFr=)rr)rrr�pop_scope_unsafexszHub.pop_scope_unsafecCsdS)Nr)rrrr�configure_scopeszHub.configure_scopecCsdS)Nr)rrHrrrrh�scs[|jd\��|dk	r9�dk	r5|��dSt��fdd��}|�S)zReconfigures the scope.r6Nc3s �dk	r�Vnt�VdS)N)rr)rr>rr�inner�sz"Hub.configure_scope.<locals>.innerr7)r:r)rrHrir)rr>rrh�s
cCs9|jd\}}|dk	r5|jd|d|�SdS)zAlias for self.client.flushr6N�timeoutrHr7)r:�flush)rrjrHrr>rrrrk�sz	Hub.flush)r r!r"�__doc__r:rrrrIrOr1rrPr#rSrYr^r]rerrfr>rgrhrkrrrrr�s0
)%r)!rZrBr$r�
contextlibr�warningsrZsentry_sdk._compatrZsentry_sdk.scoperZsentry_sdk.clientrZsentry_sdk.utilsrr	r
rrr,r&r�objectrr*r_r+r2r5rr.r/rrrr�<module>s,"
	.�	

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 1.47 KB 0644
__init__.cpython-35.pyc File 1.47 KB 0644
_compat.cpython-35.opt-1.pyc File 2.54 KB 0644
_compat.cpython-35.pyc File 2.57 KB 0644
api.cpython-35.opt-1.pyc File 2.91 KB 0644
api.cpython-35.pyc File 2.91 KB 0644
client.cpython-35.opt-1.pyc File 6.53 KB 0644
client.cpython-35.pyc File 6.53 KB 0644
consts.cpython-35.opt-1.pyc File 911 B 0644
consts.cpython-35.pyc File 911 B 0644
debug.cpython-35.opt-1.pyc File 1.59 KB 0644
debug.cpython-35.pyc File 1.59 KB 0644
hub.cpython-35.opt-1.pyc File 12.04 KB 0644
hub.cpython-35.pyc File 12.14 KB 0644
scope.cpython-35.opt-1.pyc File 6.78 KB 0644
scope.cpython-35.pyc File 6.78 KB 0644
transport.cpython-35.opt-1.pyc File 5.86 KB 0644
transport.cpython-35.pyc File 5.86 KB 0644
utils.cpython-35.opt-1.pyc File 22.01 KB 0644
utils.cpython-35.pyc File 22.13 KB 0644
worker.cpython-35.opt-1.pyc File 3.34 KB 0644
worker.cpython-35.pyc File 3.34 KB 0644