Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/persisted/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyc


ΔMc@sdZddlZddlmZmZdddYZdefdYZdefd	YZd
efdYZddd
YZ	defdYZ
ddlmZdddYZ
deefdYZdS(s7
Utility classes for dealing with circular references.
iN(tlogtreflecttNotKnowncBs2eZdZdZdZdZdZRS(cCsg|_d|_dS(Ni(t
dependantstresolved(tself((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyt__init__s	cCs*|jst|jj||fdS(N(RtAssertionErrorRtappend(Rt
mutableObjecttkey((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pytaddDependantscCs\d|_||_xC|jD]8\}}|||<t|tr|j||qqWdS(Ni(RtresolvedObjectRt
isinstanceRR(Rt	newObjecttmutR
((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pytresolveDependantss		
cCsdstddS(Nis(I am not to be used as a dictionary key.(R(R((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyt__hash__#sN(t__name__t
__module__RRtNoneRRR(((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyRs
			t
_ContainercBs eZdZdZdZRS(sK
    Helper class to resolve circular references on container objects.
    cCstj|||_||_tt||_xTtt|D]@}t||tss|jj	|qG||j
||qGW|js|j|j|jndS(s
        @param l: The list of object which may contain some not yet referenced
        objects.

        @param containerType: A type of container objects (e.g., C{tuple} or
            C{set}).
        N(RRt
containerTypetltrangetlentlocstxrangeR
tremoveRR(RRRtidx((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR-s
			cCsX||j|<t|tsT|jj||jsT|j|j|jqTndS(s
        Change the value of one contained objects, and resolve references if
        all objects have been referenced.
        N(RR
RRRRR(Rtntobj((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyt__setitem__Bs

	(RRt__doc__RR (((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR(s	t_TuplecBseZdZdZRS(sa
    Manage tuple containing circular references. Deprecated: use C{_Container}
    instead.
    cCstj||tdS(si
        @param l: The list of object which may contain some not yet referenced
        objects.
        N(RRttuple(RR((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyRUs(RRR!R(((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR"Ost_InstanceMethodcBs#eZdZdZdZRS(cCs3tj|||_||_|j|ddS(Ni(RRtmy_classtnameR(Rtim_nametim_selftim_class((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR_s
		cOslddl}tjdtj|j|jftjd||f|jdtjdsht	dS(Nisinstance method %s.%ssbeing called with %r %rtfilei(
t	tracebackRtmsgRtqualR%R&tprint_stacktlogfileR(RtargstkwR+((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyt__call__fs
&cCs`|dkstdt|ts\tj|jj|j||j}|j|ndS(Nisonly zero index allowed(	RR
Rttypest
MethodTypeR%t__dict__R&R(RRRtmethod((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR ms
(RRRR2R (((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR$^s		t_DictKeyAndValuecBseZdZdZRS(cCs
||_dS(N(tdict(RR8((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyRuscCsn|dkrtdn|r-||_n	||_t|drjt|drj|j|j|j<ndS(Niis6DictKeyAndValue should only ever be called with 0 or 1R
tvalue(ii(tRuntimeErrorR9R
thasattrR8(RRR((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR ws	(RRRR (((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR7ts	t_DereferencecBseZdZRS(cCstj|||_dS(N(RRtid(RR=((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyRs
(RRR(((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR<s(tDeferredt_CatchercBseZdZRS(cCs
||_dS(N(R9(RR9((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pytcatchs(RRR@(((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR?st_DefercBs)eZdZdZdZdZRS(cCs(tj|tj||jdS(N(R>RRtpause(R((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyRs

icCs<|jr"td||fn	d|_|j|dS(Ns4setitem should only be called once, setting %r to %ri(twassetR:tcallback(RRR((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyR s		cCs7tj||||j|j}|j|dS(N(RRtunpausetresultR(RtdepR
tresovd((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyRs
	(RRRRCR R(((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyRAs		((((R!R3ttwisted.pythonRRRRR"R$R7R<ttwisted.internet.deferR>R?RA(((s>/usr/lib/python2.7/dist-packages/twisted/persisted/crefutil.pyt<module>	s'