Your IP : 216.73.216.213


Current Path : /opt/alt/python27/lib/python2.7/site-packages/py/_io/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pyc

�
%q�]c@s\ddlZddlZeZejjdd�Zdejfd��YZdd�Z	dS(i����NtreprtreprlibtSafeReprcBs2eZdZd�Zd�Zd�Zd�ZRS(s� subclass of repr.Repr that limits the resulting size of repr()
        and includes information on exceptions raised during the call.
    cCs|jtjj||�S(N(t_callhelperRtReprR(tselftx((s@/opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pyRscCs�d�}|||j �}t|�|jkr�td|jdd�}td|jd|�}||| |t|�|�}|| d|t|�|}n|S(NcSsdd|kr tjjd�|Sd|kr@tjjd�|Stjjd�|jdd�SdS(Nt's'%s't"s"%s"s\'(tpytbuiltint_totexttreplace(tu((s@/opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pyRs
iiis...(t	maxstringtlentmax(RRtlevelRtstitj((s@/opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pytrepr_unicodes	"#cCs|jt|�S(N(Rtbuiltin_repr(RRR((s@/opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pyt
repr_instance scGs'y|||�}Wn�tjjk
r/�n�tj�\}}}t|dd�}yt|�}	Wn&tjjk
r��n
d}	nXd||	|jjt	|�fSXt
|�|jkrtd|jdd�}
td|jd|
�}||
 d|t
|�|}n|SdS(Nt__name__tunknowns/<[%s("%s") raised in repr()] %s object at 0x%x>iiis...(
R	R
t_sysextsystexc_infotgetattrtstrt	__class__RtidRtmaxsizeR(RtcallRtargsRtclstettbtexc_nameRRR((s@/opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pyR#s(
#(Rt
__module__t__doc__RRRR(((s@/opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pyRs
			i�cCs1t�}||_||_d|_|j|�S(sP return a size-limited safe repr-string for the given object.
    Failing __repr__ functions of user instances will be represented
    with a short exception info and 'saferepr' generally takes
    care to never raise exceptions itself.  This function is a wrapper
    around the Repr/reprlib functionality of the standard 2.6 lib.
    i�(RRR!tmaxotherR(tobjR!tsrepr((s@/opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pytsaferepr;s
				(
R	RRRR
t
_tryimportRRRR-(((s@/opt/alt/python27/lib/python2.7/site-packages/py/_io/saferepr.pyt<module>s
3