MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/2/cwd/usr/lib/python2.4/Demo/metaclasses/Trace.pyc
mò
‚=5Dc@s§dZdkZdkZdfd„ƒYZdfd„ƒYZdfd„ƒYZdefd	„ƒYZed
fhdd<ƒZd„Z	e
d
joe	ƒndS(s?Tracing metaclass.

XXX This is very much a work in progress.

NtTraceMetaClasscBs>tZdZdZd„Zd„Zd„Zd„ZeZ	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(tnametselft__name__tbasest	__bases__tdictt_TraceMetaClass__dictt_TraceMetaClass__inited(RRRR((t,/usr/lib/python2.4/Demo/metaclasses/Trace.pyt__init__s			cCsmy|i|SWnWtj
oKx8|iD]-}y|i|ƒSWq*tj
oq*Xq*Wt|‚nXdS(N(RRRtKeyErrorRtbaset__getattr__tAttributeError(RRR((R	R
s
	cCs,|ip||i|<n||i|<dS(N(RRtvaluet__dict__RR(RRR((R	t__setattr__(s
cOs\tƒ}|i|ƒy|idƒ}Wntj
od„}nXt|||ƒ|S(NR
cCsdS(N(tNone(((R	t<lambda>4s(
tTracingInstancetinstt
__meta_init__RR
tinitRtapplytargstkw(RRRRR((R	t__call__.s	
(
Rt
__module__t__doc__RR
R
RRRt__trace_output__(((R	R	s					
RcBs)tZdZd„Zd„Zd„ZRS(s9Helper class to represent an instance of a tracing class.cGs|i|d|ƒdS(Ns
(tfptwritetfmtR(RRR!R((R	t__trace_call__=scCs
||_dS(N(tklassRt_TracingInstance__class(RR#((R	R@scCs§y|ii|ƒ}Wntj
ot|‚nXt|ƒtijo|Sn|ii	d|}|ip
|djot|||ƒSnt
|||ƒSdS(Nt.R"(RR$R
RtrawRttypettypestFunctionTypeRtfullnameRtNotTracingWrappertTracingWrapper(RRR&R*((R	R
Cs(RRRR"RR
(((R	R:s		R+cBstZd„Zd„ZRS(NcCs||_||_||_dS(N(RRRtfuncR(RRR-R((R	R
Ss		cOst|i|if||ƒS(N(RRR-RRR(RRR((R	RWs(RRR
R(((R	R+Rs	R,cBstZd„ZRS(NcOsÈ|ii|iid|i|i||ƒy#t|i|if||ƒ}WnMt
iƒ\}}}|ii|iid|i||ƒ|||‚n'X|ii|iid|i|ƒ|SdS(Ns#calling %s, inst=%s, args=%s, kw=%ss'returning from %s with exception %s: %ssreturning from %s with value %s(RRR"RRRRRR-trvtsystexc_infotttvttb(RRRR.R1R2R3((R	R#
(RRR(((R	R,ZstTracedRcCsédtfd„ƒYadtfd„ƒYatdƒ}|GH|iGH|idƒGH|idƒGH|idƒGH|id	ƒGH|id
ƒGH|iGHtiGHtiGHtiGHtiGHtƒ}|GH|idƒGH|idƒGH|iGHdS(NtCcBs/tZdd„Zd„Zd„ZeiZRS(NicCs
||_dS(N(txR(RR6((R	R
sscCs
||_dS(N(R6R(RR6((R	tm1tscCs|i|S(N(RR6ty(RR8((R	tm2us(RRR
R7R9R/tstdoutR(((R	R5rs		tDcBstZd„ZdZRS(NcCsd|fGHti||ƒS(NsD.m2(%r)(R8R5R9R(RR8((R	R9xs(RRR9RR(((R	R;ws	iáidi
i!ii (R4R5R;R6R7R9R
R8(R8R6((R	t_testps*	t__main__(RR(R/RRR+R,RR4R<R(R,R<R4R+R/RRR(((R	t?s1