Your IP : 3.22.42.25


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

�
��Yc@@s�dZddlmZddlmZmZddlmZddlm	Zddl
mZyddlm
ZWn!ek
r�ddlm
ZnXe�Zd�Zd	eeefd
��YZddlZdS(s�
raven.context
~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
i(tabsolute_import(tMappingtIterable(tlocal(tref(t	iteritems(t	get_identcC@s*yttj�SWntk
r%gSXdS(s7Returns all the active contexts for the current thread.N(tlistt_active_contextstcontextstAttributeError(((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pytget_active_contextss
tContextcB@s�eZdZdd�Zed��Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zed�Zd
�Zed�Zd�Zd�Zdd�ZRS(s'
    Stores context until cleared.

    >>> def view_handler(view_func, *args, **kwargs):
    >>>     context = Context()
    >>>     context.merge(tags={'key': 'value'})
    >>>     try:
    >>>         return view_func(*args, **kwargs)
    >>>     finally:
    >>>         context.clear()
    cC@sqtjj|dkp|j�}|dk	r<t|�}n||_|j�i|_t	�|_
||_dS(N(traventbreadcrumbstmake_buffertNonetenable_breadcrumbstweakreft_clienttactivatetdatatsettexceptions_to_skip(tselftclientR((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__init__.s		
	cC@s|jdkrdS|j�S(N(RR(R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyR=scC@s
t|�S(N(tid(R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__hash__CscC@s
||kS(N((Rtother((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__eq__FscC@s|j|�S(N(R(RR((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__ne__IscC@s|j|S(N(R(Rtkey((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__getitem__LscC@s
t|j�S(N(titerR(R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__iter__OscC@s
t|j�S(N(tlenR(R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__len__RscC@sdt|�j|jfS(Ns<%s: %s>(ttypet__name__R(R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__repr__UscC@s|j�|S(N(R(R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt	__enter__Xs
cC@s|j�dS(N(t
deactivate(Rtexc_typet	exc_valuettb((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt__exit__\scC@s8|rt�|_ntjjdt��j|�dS(NR	(tget_thread_identt_sticky_threadRt__dict__t
setdefaultRtadd(Rtsticky((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyR_scC@s,ytjj|�Wntk
r'nXdS(N(RR	tdiscardR
(R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyR*ds
cC@s�|r|j�n|j}xnt|�D]`\}}|dkr|j|i�x5t|�D]\}}||||<q^Wq)|||<q)WdS(Nttagstextra(R6R7(RRRR2(RRRtdR tvaluett_keytt_value((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pytmergejs
	cC@s
||_dS(N(R(RR((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyRvscC@s|jS(N(R(R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pytgetyscC@ssi|_|jj�|jj�|dkr\|j}|dk	r\t�|jk}q\n|ro|j�ndS(N(	RRtclearRRRR/tmain_thread_idR*(RR*R((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyR>|s	

	N(R't
__module__t__doc__RRtpropertyRRRRR!R#R%R(R)R.tFalseRR*tTrueR<RR=R>(((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyR!s$												N(RAt
__future__RtcollectionsRRt	threadingRRRtraven.utils.compatRtthreadRR/tImportErrort_threadRRRtraven.breadcrumbsR
(((s>/opt/alt/python27/lib/python2.7/site-packages/raven/context.pyt<module>s
		l

?>