ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
Yc           @@  s  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l m Z m	 Z	 m
 Z
 m Z d  d l m Z g  Z i  Z e j d  Z d   Z d e f d	     YZ d
 e f d     YZ e d  Z d   Z d d d d d d d d  Z d   Z d d  Z d   Z e d    Z d d  Z d   Z  d   Z! i  Z" d   Z# e# d  d    Z$ e# d  d    Z% d   Z& d  d l' Z( d S(   i    (   t   absolute_importN(   t   FunctionType(   t	   iteritemst   get_codet	   text_typet   string_types(   t   oncet   ravenc         C@  sb   |  d | d k oa |  d | d k oa |  d | d k oa |  d | d k oa |  d | d k S(   Nt   typet   levelt   messaget   categoryt   data(    (   t   at   b(    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   event_payload_considered_equal   s
    t   BreadcrumbBufferc           B@  sD   e  Z d  d  Z d d d d d d d d  Z d   Z d   Z RS(   id   c         C@  s   g  |  _  | |  _ d  S(   N(   t   buffert   limit(   t   selfR   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   __init__   s    	c         C@  s   | p | p | s! t  d   n  | d  k r< t j   } n  |  j j i | pQ d d 6| d 6| d 6| d 6| d 6| d 6| f  |  j |  j 4d  S(	   Ns6   You must pass either `message`, `data`, or `processor`t   defaultR   t	   timestampR	   R
   R   R   (   t
   ValueErrort   Nonet   timeR   t   appendR   (   R   R   R	   R
   R   R   R   t	   processor(    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   record#   s    
c         C@  s   |  j  2d  S(   N(   R   (   R   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   clear4   s    c         C@  s   g  } x t  |  j  D] \ } \ } } | d  k	 r y | |  Wn$ t k
 rh t j d  d  } n X| d  f |  j | <n  | d  k	 r | s t | d |  r | j |  q q W| S(   Ns&   Failed to process breadcrumbs. Ignoredi(   t	   enumerateR   R   t	   Exceptiont   loggert	   exceptionR   R   (   R   t   rvt   idxt   payloadR   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt
   get_buffer7   s    "
N(   t   __name__t
   __module__R   R   R   R   R%   (    (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyR      s
   		t   BlackholeBreadcrumbBufferc           B@  s   e  Z d    Z RS(   c         O@  s   d  S(   N(    (   R   t   argst   kwargs(    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyR   H   s    (   R&   R'   R   (    (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyR(   G   s   c         C@  s   |  r t    St   S(   N(   R   R(   (   t   enabled(    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   make_bufferL   s    c         O@  s   |  | d <t  | |   S(   NR   (   R   (   R   R)   R*   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   record_breadcrumbR   s    
c      	   C@  s[   | d k r t j   } n  x9 t j j   D]( } | j j | | |  | | | |  q+ Wd S(   s   Records a breadcrumb for all active clients.  This is what integration
    code should use rather than invoking the `captureBreadcrumb` method
    on a specific client.
    N(   R   R   R   t   contextt   get_active_contextst   breadcrumbsR   (   R
   R   R	   R   R   R   R   t   ctx(    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyR   X   s
    c         @  s   x0 t  D]( } |        } | r d  Sq Wt j  j  } | d  k	 rv |        } | rv d  Sn        f d   } t d |  d  S(   Nc         @  s    } y# t    }   r(    } n  Wn t k
 r< n X j d d   |  j i | d 6 j d 6t j   j   d 6 d 6 d  S(   Nt   exc_infoR
   R   R	   R   (	   R   R   t   popR   t   updatet   namet   loggingt   getLevelNamet   lower(   R   t   formatted_msg(   R)   R*   R	   R    t   msg(    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyR   q   s    	
R   (   t   special_logging_handlerst   special_logger_handlerst   getR5   R   R   (   R    R	   R:   R)   R*   t   handlerR"   R   (    (   R)   R*   R	   R    R:   sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   _record_log_breadcrumbe   s    c   	      C@  sn  t  |  t  s |  j } n |  } t | d t  r7 d  S| d  k rR d } d } n d } d | } t |  } t j } | d  k r t	 j
 j t j j j  } n  i  } t t d i d | j d d	 6| j d
 6d j |  d 6| d 6| d 6| d  t j |  | d |  t  } | j | _ | j t |  j k sAt  | j | j k | j | j k t | _ | S(   Nt   __patched_for_raven__R	   R:   s
   level, msgs   %d, msgs  %(offset)sif 1:
    def factory(original, record_crumb):
        def %(name)s(self, %(args)s, *args, **kwargs):
            record_crumb(self, %(fwd)s, *args, **kwargs)
            return original(self, %(args)s, *args, **kwargs)
        return %(name)s
    
s   
i   t   offsetR5   s   , R)   t   fwdt   exect   factory(   R	   R:   (   R:   (   t
   isinstanceR   t   im_funct   getattrt   FalseR   R   R6   t   _srcfilet   ost   patht   normpatht   currentframet   __code__t   co_filenamet   evalt   compilet   co_firstlinenoR&   t   joint   __dict__R?   t   __doc__t   AssertionErrorR'   t   TrueR@   (	   t   methR	   t   funcR)   RB   t   codet   logging_srcfilet   nst   new_func(    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   _wrap_logging_method   s>    	
		
	c          C@  s   t  j }  i t  j d 6t  j d 6t  j d 6t  j d 6t  j d 6t  j d 6t  j d 6t  j d 6} xE t	 |  D]7 \ } } t
 t |  |  |  } t t  j | |  ql Wt
 t  j j  t  j _ d  S(	   Nt   debugt   infot   warningt   warnt   errorR!   t   criticalt   fatal(   R6   t   Loggert   DEBUGt   INFOt   WARNINGt   WARNt   ERRORt   CRITICALt   FATALR   R^   RG   t   setattrt   log(   t   clst   methodst   method_nameR	   R]   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   _patch_logger   s     	






c           C@  s   t    d S(   sX   Installs the logging hook if it was not installed yet.  Otherwise
    does nothing.
    N(   Rs   (    (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   install_logging_hook   s    c         @  s      f d   } t  |  |  d S(   s   Ignores a logger for the regular breadcrumb code.  This is useful
    for framework integration code where some log messages should be
    specially handled.
    c         @  s      d  k	 r |   k r t St S(   N(   R   RH   RW   (   R    R	   R:   R)   R*   (   t   allow_level(    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyR>      s    N(   t   register_special_log_handler(   t   name_or_loggerRu   R>   (    (   Ru   sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   ignore_logger   s    c         C@  s/   t  |  t  r |  } n	 |  j } | t | <d S(   s  Registers a callback for log handling.  The callback is invoked
    with give arguments: `logger`, `level`, `msg`, `args` and `kwargs`
    which are the values passed to the logging system.  If the callback
    returns `True` the default handling is disabled.
    N(   RE   R   R5   R<   (   Rw   t   callbackR5   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyRv      s    		c         C@  s   t  j |   d S(   s  Registers a callback for log handling.  The callback is invoked
    with give arguments: `logger`, `level`, `msg`, `args` and `kwargs`
    which are the values passed to the logging system.  If the callback
    returns `True` the default handling is disabled.
    N(   R;   R   (   Ry   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   register_logging_handler
  s    c         @  s     f d   } | S(   Nc         @  s   t  |   }  |  t   <|  S(   N(   R   t   hooked_libraries(   t   f(   R5   (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt	   decorator  s    
(    (   R5   R}   (    (   R5   sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   libraryhook  s    t   requestsc          @  sa   y d d l  m }  Wn t k
 r( d  SX|  j     f d   } | |  _ t d d t j d  S(   Ni    (   t   Sessionc         @  sW     f d   } y  |    | |  } Wn t  k
 rH | d     n X| |  | S(   Nc      	   @  s]   t  d d d d d i   j d 6  j d 6|  r8 |  j p; d  d 6|  rN |  j pQ d  d	 6 d  S(
   NR   t   httpR   R   R   t   urlt   methodt   status_codet   reason(   R   R   R   R   R   R   (   t   response(   t   request(    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   _record_request(  s
    

(   R   R   (   R   R   R)   R*   R   t   resp(   t	   real_send(   R   sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   send'  s    

s(   requests.packages.urllib3.connectionpoolRu   (   t   requests.sessionsR   t   ImportErrorR   Rx   R6   Ri   (   R   R   (    (   R   sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   _hook_requests  s    			t   httplibc          @  s~   y d d l  m }  Wn! t k
 r7 d d l m }  n X|  j  |  j    f d   }   f d   } | |  _ | |  _ d  S(   Ni    (   t   HTTPConnectionc         @  su   i  |  _   |  j  |  j  |  j          f d   } t d d d d d |   |    | |  S(   Nc         @  s    } | j  d  sV d   d k r* d p- d     k rF d  pI d  f } n  i | d	 6 d
 6|  d <|  d j   |  S(   Ns   http://s   https://s   %s://%s%s%si  t   httpsR   s   :%st    R   R   R   (   s   http://s   https://(   t
   startswithR4   (   R   t   real_url(   t   default_portt   hostR   t   portt   statusR   (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyR   N  s    R   R   R   R   R   (   t   _raven_status_dictR   R   R   R   (   R   R   R   R)   R*   R   (   t   real_putrequest(   R   R   R   R   R   R   sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt
   putrequestH  s    			c         @  s]     |  | |  } t  |  d d   } | d  k	 rY d | k rY | j | d <| j | d <n  | S(   NR   R   R   (   RG   R   R   R   (   R   R)   R*   R"   R   (   t   real_getresponse(    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   getresponse`  s    (   R   R   R   t   http.clientR   R   (   R   R   R   (    (   R   R   sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   _install_httplib>  s    			c         C@  se   |  d  k r t j   }  n  xC |  D]; } t j |  } | d  k rV t d |   n  |   q" Wd  S(   Ns   Unknown library %r for hooking(   R   R{   t   keysR=   t   RuntimeError(   t	   librariest   libRY   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   hook_librariesl  s    ()   t
   __future__R    RJ   R   R6   t   typesR   t   raven.utils.compatR   R   R   R   t   raven.utilsR   R;   R<   t	   getLoggerR    R   t   objectR   R(   RW   R,   R-   R   R   R?   R^   Rs   Rt   Rx   Rv   Rz   R{   R~   R   R   R   t   raven.contextR   (    (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/raven/breadcrumbs.pyt   <module>   s:   "	
*		&F					 .	
