Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib/python3.7/site-packages/raven/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/raven/__pycache__/events.cpython-37.pyc

B

��YA�@s�dZddlmZddlZddlZddlmZddlmZm	Z	dZ
Gdd�de�Ze
ed	�rdd
d�Zndd�ZGd
d�de�ZGdd�de�ZGdd�de�ZdS)z�
raven.events
~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.

�)�absolute_importN)�
to_unicode)�get_stack_info�iter_traceback_frames)�	BaseEvent�	Exception�Message�Queryc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs||_t�t�|_dS)N)�client�logging�	getLogger�__name__�logger)�selfr
�r�=/opt/alt/python37/lib/python3.7/site-packages/raven/events.py�__init__szBaseEvent.__init__cCst�dS)N)�NotImplementedError)r�datarrr�	to_stringszBaseEvent.to_stringcKsiS)Nr)r�kwargsrrr�captureszBaseEvent.capturecCs|j�|�S)N)r
�	transform)r�valuerrrr szBaseEvent.transformN)r
�
__module__�__qualname__rrrrrrrrrsr�__suppress_context__ccsn|V|\}}}t�}|�|�xH|jr0|j}n|j}||kr@P|�|�|dkrTPt|�||jfVq"WdS)z�
        Return a generator iterator over an exception's chain.

        The exceptions are yielded from outermost to innermost (i.e. last to
        first when viewing a stack trace).

        N)�set�addr�	__cause__�__context__�type�
__traceback__)�exc_info�exc_type�exc�
exc_traceback�contextrrr�_chained_exceptions(s


r(ccs
|VdS)Nr)r#rrrr(Csc@s.eZdZdZdZdd�Zdd�Zd
dd	�ZdS)rz�
    Exceptions store the following metadata:

    - value: 'My exception value'
    - type: 'ClassName'
    - module '__builtin__' (i.e. __builtin__.TypeError)
    - frames: a list of serialized frames (see _get_traceback_frames)

    �	exceptioncCs6||jdd}|dr.d|d|dfS|dS)N�values���rz%s: %sr!)�name)rrr%rrrrTszException.to_stringcCsVtt|�|j|jjd�}t|dd�}|r0t|�}t|dd�}t|�t|�t|�|d�S)zH
        Convert exception info to a value for the values list.
        )Ztransformer�capture_localsrNr
z	<unknown>)rr!�moduleZ
stacktrace)rrrr
r-�getattr�strr)rr$�	exc_valuer&�
stack_infoZ
exc_modulerrr�
_get_valueZszException._get_valueNcKsh|r|dkrt��}|s td��g}x&t|�D]}|j|�}|�d|�q.Wd|�dtj�|j	d|iiS)NTzNo exception foundr�levelr*)
�sysr#�
ValueErrorr(r3�insert�getr�ERRORr,)rr#rr*rrrrrps
zException.capture)N)r
rr�__doc__r,rr3rrrrrrGs
	rc@s&eZdZdZdZdd�Zd	dd�ZdS)
rz{
    Messages store the following metadata:

    - message: 'My message from %s about %s'
    - params: ('foo', 'bar')
    zsentry.interfaces.MessagecCs||jdS)N�message)r,)rrrrrr�szMessage.to_stringrNcKs8t|�}|j||�|�|d�i}d|kr4|p.||d<|S)N)r;�params�	formattedr;)rr,r)rr;r<r=rrrrrr�s
zMessage.capture)rN)r
rrr:r,rrrrrrr�src@s$eZdZdZdZdd�Zdd�ZdS)r	zw
    Messages store the following metadata:

    - query: 'SELECT * FROM table'
    - engine: 'postgesql_psycopg2'
    zsentry.interfaces.QuerycCs||j}|dS)N�query)r,)rrZsqlrrrr�s
zQuery.to_stringcKs|jt|�t|�d�iS)N)r>�engine)r,rr0)rr>r?rrrrr�sz
Query.captureN)r
rrr:r,rrrrrrr	�sr	)r:�
__future__rrr5Zraven.utils.encodingrZraven.utils.stacksrr�__all__�objectr�hasattrrr(rr	rrrr�<module>s

;

Hacked By AnonymousFox1.0, Coded By AnonymousFox