£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>

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 y d d l	 m
 Z
 Wn e k
 r{ e Z
 n Xd   Z d e
 f d	     YZ d
 e
 f d     YZ d e
 f d     YZ e Z d e
 f d     YZ d S(   s   
raven.contrib.django.middleware
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

: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   settings(   t   request_finished(   t   MiddlewareMixinc         @  s&   t    f d   t t d d  D  S(   sV   
    Returns True if a 404 at the given URL *shouldn't* notify the site managers.
    c         3@  s   |  ] } | j     Vq d  S(   N(   t   search(   t   .0t   pattern(   t   uri(    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pys	   <genexpr>   s   t   IGNORABLE_404_URLS(    (   t   anyt   getattrR   (   R   (    (   R   sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyt   is_ignorable_404   s    t   Sentry404CatchMiddlewarec           B@  s   e  Z d    Z RS(   c         C@  s   | j  d k r | St | j    r) | Sd d l m } | j   sI | S| j |  } | j i t j	 d 6d d 6 | j
 d d | j   d	 |  } | s d  Si | j d
 | j j  d 6| j |  d 6| _ | S(   Ni  i    (   t   clientt   levelt   http404t   loggert   messages   Page Not Found: %st   datat   projectt
   project_idt   id(   t   status_codeR   t   get_full_patht   raven.contrib.django.modelsR   t
   is_enabledt   get_data_from_requestt   updatet   loggingt   INFOt   captureMessaget   build_absolute_urit   gett   remoteR   t	   get_identt   sentry(   t   selft   requestt   responseR   R   t   result(    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyt   process_response%   s$    	
"(   t   __name__t
   __module__R(   (    (    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyR   $   s   t   SentryResponseErrorIdMiddlewarec           B@  s   e  Z d  Z d   Z RS(   sl   
    Appends the X-Sentry-ID response header for referencing a message within
    the Sentry datastore.
    c         C@  s+   t  | d d   s | S| j d | d <| S(   NR#   R   s   X-Sentry-ID(   R
   t   NoneR#   (   R$   R%   R&   (    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyR(   I   s    (   R)   R*   t   __doc__R(   (    (    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyR+   C   s   t   SentryMiddlewarec           B@  s/   e  Z e j   Z d    Z d   Z d   Z RS(   c         C@  s/   d  |  _ | t j _ t j |  j d t d  S(   Nt   weak(   R,   t   _txidR.   t   threadR%   R   t   connectt   False(   R$   R%   (    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyt   process_requestS   s    	c         C@  so   d d l  m } y" | j j | j |   |  _ Wn6 t k
 rj } | j j t	 |  d i | d 6n Xd  S(   Ni    (   R   t   extraR%   (   R   R   t   transactiont   pusht   get_transaction_from_requestR0   t	   Exceptiont   error_loggert	   exceptiont   reprR,   (   R$   R%   t   funct   argst   kwargsR   t   exc(    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyt   process_view`   s    	'c         K@  sa   d d l  m } t |  d d   rA | j j |  j  d  |  _ n  d  t j _	 t
 j |  j
  d  S(   Ni    (   R   R0   (   R   R   R
   R,   R6   t   popR0   R.   R1   R%   R   t
   disconnect(   R$   R?   R   (    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyR   l   s    (   R)   R*   t	   threadingt   localR1   R4   RA   R   (    (    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyR.   P   s   		t#   DjangoRestFrameworkCompatMiddlewarec           B@  s   e  Z d Z d   Z RS(   s!   application/x-www-form-urlencodeds   multipart/form-datas   application/octet-streamc         C@  sD   | j  j d d  } x! |  j D] } | | k r d Sq W| j d S(   s~   
        Access request.body, otherwise it might not be accessible later
        after request has been read/streamed
        t   CONTENT_TYPEt    N(   t   METAR    t   non_cacheable_typest   body(   R$   R%   t   content_typet   non_cacheable_type(    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyR4      s
    (   s!   application/x-www-form-urlencodeds   multipart/form-datas   application/octet-stream(   R)   R*   RJ   R4   (    (    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyRF   {   s     (   R-   t
   __future__R    R   RD   t   django.confR   t   django.core.signalsR   t   django.utils.deprecationR   t   ImportErrort   objectR   R   R+   R.   t   SentryLogMiddlewareRF   (    (    (    sY   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/middleware/__init__.pyt   <module>   s   
	
(