Hacked By AnonymousFox

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

�
��Yc@@sdZddlmZddlZddlZddlmZmZmZm	Z	m
Z
mZmZddl
mZddlmZdZd	�Zdefd
��YZdefd��YZd
efd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZer�defd��YZneje�eje�eje�eje�eje�eje�eje�eje�eje�ereje�ndS( s�
raven.utils.serializer.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
i(tabsolute_importN(t	text_typetbinary_typetstring_typest	iteritemstclass_typestPY2tPY3(t
to_unicodei(tmanagert
SerializercC@s0yt|jd��SWntk
r+tSXdS(Nt
__sentry__(tcallablet__getattribute__t	ExceptiontFalse(tvalue((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pythas_sentry_metadatas
cB@s8eZdZd�Zd�Zd�Zddd�ZRS(cC@s
||_dS(N(R	(tselfR	((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyt__init__ scC@st||j�S(s|
        Given ``value``, return a boolean describing whether this
        serializer can operate on the given type
        (t
isinstancettypes(RR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pytcan#scK@s|S(s@
        Given ``value``, coerce into a JSON-safe type.
        ((RRtkwargs((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyt	serialize*siicK@s�|jdd�}|d7}||kr�ytt|��| }Wq�tk
r�}ddl}|j�|jjj	|�tt
|��SXn|jj|d|d||�S(s|
        Given ``value``, recurse (using the parent serializer) to handle
        coercing of newly defined values.
        tstring_max_lengthiiNt	max_deptht_depth(tgettNoneRtreprRt	tracebackt	print_excR	tloggert	exceptionttypet	transform(RRRRRRteR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pytrecurse0s

((t__name__t
__module__RRRRR&(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR
s
			tIterableSerializercB@s#eZeeeefZd�ZRS(c@sS�jd�ptd��t��fd�tj�fd�t|��D��S(Ntlist_max_lengthtinfc3@s'|]\}}�j|��VqdS(N(R&(t.0tnto(RR(sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pys	<genexpr>Jsc@s|d�kS(Ni((tx(R*(sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyt<lambda>Lt(Rtfloatttuplet	itertoolst	takewhilet	enumerate(RRR((RR*RsL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRGs
(R'R(R3tlisttsett	frozensetRR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR)DstDictSerializercB@s#eZefZd�Zd�ZRS(cC@st|t�st|�S|S(N(RRR(Rtkey((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pytmake_keyTs
c@sY�jd�ptd��t��fd�tj�fd�tt|���D��S(NR*R+c3@sH|]>\}\}}�j�j|����j|��fVqdS(N(R<R&(R,R-tktv(RR(sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pys	<genexpr>\sc@s|d�kS(Ni((R/(R*(sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR0^R1(RR2tdictR4R5R6R(RRR((RR*RsL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRYs
(R'R(R?RR<R(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR:Qs		tUnicodeSerializercB@seZefZd�ZRS(cK@s-|jdd�}ttd��|| fS(NRs%s(RRRR(RRRR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRfs(R'R(RRR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR@cs	tStringSerializercB@seZefZd�ZRS(cK@sn|jdd�}tr&t|| �Sy&d|jd�| jd�dSWntk
r_nXt|| �S(NRt'tutf8(RRRRtdecodetencodetUnicodeDecodeError(RRRR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRrs&
(R'R(RRR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRAos	tTypeSerializercB@s eZeZd�Zd�ZRS(cC@s#tt|�j|�o"t|�S(N(tsuperRGRR(RR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR�scK@s|j|j�|�S(N(R&R(RRR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR�s(R'R(RRRR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRG�s	tBooleanSerializercB@seZefZd�ZRS(cK@s
t|�S(N(tbool(RRR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR�s(R'R(RJRR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRI�s	tFloatSerializercB@seZefZd�ZRS(cK@s
t|�S(N(R2(RRR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR�s(R'R(R2RR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRK�s	tIntegerSerializercB@seZefZd�ZRS(cK@s
t|�S(N(tint(RRR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR�s(R'R(RMRR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRL�s	tFunctionSerializercB@seZejfZd�ZRS(cK@sd|j|jt|�fS(Ns<function %s from %s at 0x%x>(R'R(tid(RRR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR�s(R'R(RtFunctionTypeR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRN�stLongSerializercB@seZefZd�ZRS(cK@s
t|�S(N(tlong(RRR((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyR�s(R'R(RRRR(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyRQ�s	(R
( t__doc__t
__future__RR4Rtraven.utils.compatRRRRRRRtraven.utils.encodingRR	tserialization_managert__all__RtobjectR
R)R:R@RARGRIRKRLRNRQtregister(((sL/opt/alt/python27/lib/python2.7/site-packages/raven/utils/serializer/base.pyt<module>s>4	'











Hacked By AnonymousFox1.0, Coded By AnonymousFox