Your IP : 18.118.30.153


Current Path : /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyc

�
��Yc@@sLdZddlmZddlZddlmZdefd��YZdS(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(tabsolute_importN(tClienttSentryMiddlewarecB@s&eZdZedd�Zd�ZRS(slSentry/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).
    cK@s"|pt|�|_||_dS(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(Rt_sentry_clientt_hide_zerorpc_frames(tselfthide_zerorpc_framestclienttkwargs((sO/opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyt__init__s
cC@s�|jrs|d}x]|ro|j}t|jd<tj|�}|jdks_|jdkrcPn|j}qWn|jj	|d|�dS(sU
        Called when an exception has been raised in the code run by ZeroRPC
        it__traceback_hide__t__call__t	_receivertextraN(
Rttb_frametTruetf_localstinspecttgetframeinfotfunctionttb_nextRtcaptureException(Rt	req_eventt	rep_eventttask_ctxtexc_infot	tracebackt
zerorpc_framet
frame_info((sO/opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pytserver_inspect_exception(s	
		
	N(t__name__t
__module__t__doc__RtNoneR	R(((sO/opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyRs

(R t
__future__RRt
raven.baseRtobjectR(((sO/opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyt<module>s

?>