???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
¿öYc           @@  sÚ   d  Z  d d l m Z d d l Z d d l Z d d l m Z d d l m Z m	 Z	 d Z
 d e f d
 „  ƒ  YZ e e d ƒ r‹ d „  Z n	 d „  Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e f d „  ƒ  YZ d S(   s–   
raven.events
~~~~~~~~~~~~

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

i    (   t   absolute_importN(   t
   to_unicode(   t   get_stack_infot   iter_traceback_framest	   BaseEventt	   Exceptiont   Messaget   Queryc           B@  s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C@  s   | |  _  t j t ƒ |  _ d  S(   N(   t   clientt   loggingt	   getLoggert   __name__t   logger(   t   selfR   (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyt   __init__   s    	c         C@  s
   t  ‚ d  S(   N(   t   NotImplementedError(   R   t   data(    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyt	   to_string   s    c         K@  s   i  S(   N(    (   R   t   kwargs(    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyt   capture   s    c         C@  s   |  j  j | ƒ S(   N(   R   t	   transform(   R   t   value(    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR       s    (   R   t
   __module__R   R   R   R   (    (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR      s   			t   __suppress_context__c         c@  s   |  V|  \ } } } t  ƒ  } | j | ƒ xl t r˜ | j rH | j } n	 | j } | | k ra Pn  | j | ƒ | d k r~ Pn  t | ƒ | | j f Vq- Wd S(   sÂ   
        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(	   t   sett   addt   TrueR   t	   __cause__t   __context__t   Nonet   typet   __traceback__(   t   exc_infot   exc_typet   exct   exc_tracebackt   context(    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyt   _chained_exceptions(   s    				c         c@  s	   |  Vd  S(   N(    (   R    (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR%   C   s    c           B@  s2   e  Z d  Z d Z d „  Z d „  Z d d „ Z RS(   sì   
    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)

    t	   exceptionc         C@  s=   | |  j  d d } | d r5 d | d | d f S| d S(   Nt   valuesiÿÿÿÿR   s   %s: %sR   (   t   name(   R   R   R"   (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR   T   s    
c         C@  s’   t  t | ƒ d |  j d |  j j ƒ} t | d d
 ƒ } | rN t | ƒ } n  t | d d ƒ } i t | ƒ d 6t | ƒ d 6t | ƒ d 6| d	 6S(   sH   
        Convert exception info to a value for the values list.
        t   transformert   capture_localsR   R   s	   <unknown>R   R   t   modulet
   stacktraceN(	   R   R   R   R   R*   t   getattrR   t   strR   (   R   R!   t	   exc_valueR#   t
   stack_infot
   exc_module(    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyt
   _get_valueZ   s    	c         K@  sž   | s | t  k r" t j ƒ  } n  | s7 t d ƒ ‚ n  g  } x3 t | ƒ D]% } |  j | Œ  } | j d | ƒ qJ Wi | j d t j	 ƒ d 6i | d 6|  j
 6S(   Ns   No exception foundi    t   levelR'   (   R   t   sysR    t
   ValueErrorR%   R2   t   insertt   getR	   t   ERRORR(   (   R   R    R   R'   R   (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR   p   s    N(   R   R   t   __doc__R(   R   R2   R   R   (    (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR   G   s
   			c           B@  s,   e  Z d  Z d Z d „  Z d d d „ Z RS(   s{   
    Messages store the following metadata:

    - message: 'My message from %s about %s'
    - params: ('foo', 'bar')
    s   sentry.interfaces.Messagec         C@  s   | |  j  d S(   Nt   message(   R(   (   R   R   (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR   Œ   s    c         K@  s]   t  | ƒ } i i | d 6|  j | ƒ d 6| d 6|  j 6} d | k rY | pO | | d <n  | S(   NR:   t   paramst	   formatted(   R   R   R(   (   R   R:   R;   R<   R   R   (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR      s    (    N(   R   R   R9   R(   R   R   R   (    (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR   ‚   s   	c           B@  s&   e  Z d  Z d Z d „  Z d „  Z RS(   sw   
    Messages store the following metadata:

    - query: 'SELECT * FROM table'
    - engine: 'postgesql_psycopg2'
    s   sentry.interfaces.Queryc         C@  s   | |  j  } | d S(   Nt   query(   R(   (   R   R   t   sql(    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR   §   s    c         K@  s(   i i t  | ƒ d 6t | ƒ d 6|  j 6S(   NR=   t   engine(   R   R.   R(   (   R   R=   R?   R   (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR   «   s    (   R   R   R9   R(   R   R   (    (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyR      s   	(   R   R   R   R   (   R9   t
   __future__R    R	   R4   t   raven.utils.encodingR   t   raven.utils.stacksR   R   t   __all__t   objectR   t   hasattrR   R%   R   R   (    (    (    s=   /opt/alt/python27/lib/python2.7/site-packages/raven/events.pyt   <module>   s   	;