ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/proc/thread-self/root/lib64/python2.7/Demo/metaclasses/
Upload File :
Current File : //proc/self/root/proc/self/root/proc/thread-self/root/lib64/python2.7/Demo/metaclasses/Trace.pyo

�
V
�Qc@s�dZddlZddlZddd��YZddd��YZddd��YZd	efd
��YZeddidd6�Zd
�Z	e
dkr�e	�ndS(s?Tracing metaclass.

XXX This is very much a work in progress.

i����NtTraceMetaClasscBs>eZdZdZd�Zd�Zd�Zd�ZdZ	RS(sUMetaclass for tracing.

    Classes defined using this metaclass have an automatic tracing
    feature -- by setting the __trace_output__ instance (or class)
    variable to a file object, trace messages about all calls are
    written to the file.  The trace formatting can be changed by
    defining a suitable __trace_call__ method.

    icCs(||_||_||_d|_dS(Ni(t__name__t	__bases__t_TraceMetaClass__dictt_TraceMetaClass__inited(tselftnametbasestdict((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyt__init__s			cCsiy|j|SWnStk
rdx6|jD]+}y|j|�SWq)tk
rSq)Xq)Wt|�nXdS(N(RtKeyErrorRt__getattr__tAttributeError(RRtbase((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyRs

cCs*|js||j|<n
||j|<dS(N(Rt__dict__R(RRtvalue((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyt__setattr__(s	cOsZt�}|j|�y|jd�}Wntk
rEd�}nXt|||�|S(NR	cSsdS(N(tNone(((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyt<lambda>4s(tTracingInstancet
__meta_init__RRtapply(Rtargstkwtinsttinit((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyt__call__.s	


N(
Rt
__module__t__doc__RR	RRRRt__trace_output__(((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR	s					
RcBs)eZdZd�Zd�Zd�ZRS(s9Helper class to represent an instance of a tracing class.cGs|j|d|�dS(Ns
(twrite(RtfptfmtR((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyt__trace_call__=scCs
||_dS(N(t_TracingInstance__class(Rtklass((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR@scCs�y|jj|�}Wntk
r2t|�nXt|�tjkrL|S|jjd|}|jsv|dkr�t|||�St	|||�SdS(Nt.R!(
R"RRttypettypestFunctionTypeRRtNotTracingWrappertTracingWrapper(RRtrawtfullname((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyRCs

(RRRR!RR(((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR:s		R(cBseZd�Zd�ZRS(cCs||_||_||_dS(N(RtfuncR(RRR,R((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR	Ss		cOst|j|jf||�S(N(RR,R(RRR((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyRWs(RRR	R(((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR(Rs	R)cBseZd�ZRS(cOs�|jj|jjd|j|j||�y#t|j|jf||�}WnMtj�\}}}|jj|jjd|j||�|||�n'X|jj|jjd|j|�|SdS(Ns#calling %s, inst=%s, args=%s, kw=%ss'returning from %s with exception %s: %ssreturning from %s with value %s(RR!RRRR,tsystexc_info(RRRtrvtttvttb((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR[s#
(RRR(((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR)ZstTracedRcCs�dtfd��Yadtfd��Yatd�}|GH|jGH|jd�GH|jd�GH|jd�GH|jd	�GH|jd
�GH|jGHtjGHtjGHtjGHtjGHt�}|GH|jd�GH|jd�GH|jGHdS(NtCcBs/eZdd�Zd�Zd�ZejZRS(icSs
||_dS(N(tx(RR5((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR	sscSs
||_dS(N(R5(RR5((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pytm1tscSs|j|S(N(R5(Rty((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pytm2us(RRR	R6R8R-tstdoutR(((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR4rs		tDcBseZd�ZdZRS(cSsd|fGHtj||�S(NsD.m2(%r)(R4R8(RR7((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR8xsN(RRR8RR(((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyR:ws	i�idi
i!ii�(R3R4R:R5R6R8R	(R5R7((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyt_testps(	t__main__(((((RR&R-RRR(R)RR3R;R(((s./usr/lib64/python2.7/Demo/metaclasses/Trace.pyt<module>s1	

Zerion Mini Shell 1.0