£Á°è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           @@  sL   d  Z  d d l m Z d d l Z d d l m Z d e f d     YZ d S(   s   
raven.contrib.zerorpc
~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
i    (   t   absolute_importN(   t   Clientt   SentryMiddlewarec           B@  s&   e  Z d  Z e d d  Z d   Z RS(   sl  Sentry/Raven middleware for ZeroRPC.

    >>> import zerorpc
    >>> from raven.contrib.zerorpc import SentryMiddleware
    >>> sentry = SentryMiddleware(dsn='udp://..../')
    >>> zerorpc.Context.get_instance().register_middleware(sentry)

    Exceptions detected server-side in ZeroRPC will be submitted to Sentry (and
    propagated to the client as well).
    c         K@  s"   | p t  |   |  _ | |  _ d S(   s  
        Create a middleware object that can be injected in a ZeroRPC server.

        - hide_zerorpc_frames: modify the exception stacktrace to remove the
                               internal zerorpc frames (True by default to make
                               the stacktrace as readable as possible);
        - client: use an existing raven.Client object, otherwise one will be
                  instantiated from the keyword arguments.
        N(   R   t   _sentry_clientt   _hide_zerorpc_frames(   t   selft   hide_zerorpc_framest   clientt   kwargs(    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyt   __init__   s    
c         C@  s   |  j  rs | d } x] | ro | j } t | j d <t j |  } | j d k s_ | j d k rc Pn  | j } q Wn  |  j j	 | d | d S(   sU   
        Called when an exception has been raised in the code run by ZeroRPC
        i   t   __traceback_hide__t   __call__t	   _receivert   extraN(
   R   t   tb_framet   Truet   f_localst   inspectt   getframeinfot   functiont   tb_nextR   t   captureException(   R   t	   req_eventt	   rep_eventt   task_ctxt   exc_infot	   tracebackt   zerorpc_framet
   frame_info(    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyt   server_inspect_exception(   s    	
			N(   t   __name__t
   __module__t   __doc__R   t   NoneR	   R   (    (    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyR      s   
(   R    t
   __future__R    R   t
   raven.baseR   t   objectR   (    (    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyt   <module>   s   