Ϫf'dZddlmZmZddlmZGddZGddeZGdd eZGd d eZ Gd d Z GddeZ ddl m Z Gdde eeZy)z7 Utility classes for dealing with circular references. )logreflect)_constructMethodc(eZdZdZdZdZdZdZy)NotKnownc g|_d|_yNr) dependantsresolvedselfs rc||j|<t|tsS|jj ||js+|j |j |jyyy)z Change the value of one contained objects, and resolve references if all objects have been referenced. N)r'r,rr+r-rr&r nobjs r __setitem__z_Container.__setitem__>s[ q #x( II  Q 99&&t'9'9$&&'AB)rN)r r!r"__doc__rr3rrrr$r$%s?( Crr$ceZdZdZdZy)_Tupleza Manage tuple containing circular references. Deprecated: use C{_Container} instead. c:tj||ty)zi @param l: The list of object which may contain some not yet referenced objects. N)r$rtuple)r r's rrz_Tuple.__init__Ps D!U+rN)r r!r"r4rrrrr6r6Js  ,rr6ceZdZdZdZdZy)_InstanceMethodcntj|||_||_|j |dyr )rrmy_classnamer)r im_nameim_selfim_classs rrz_InstanceMethod.__init__Ys.$   T1%rcddl}tjdtj|j d|j tjd|d||jtjJ)Nrzinstance method .zbeing called with  )file) tracebackrmsgrqualr<r= print_stacklogfile)r argskwrEs r__call__z_InstanceMethod.__call__`se "7<< #>"?q LM $THAbV453;;/qrc|dk(sJdt|ts3t|j|j|}|j |yy)Nrzonly zero index allowed)r,rrr<r=r)r r1r2methods rr3z_InstanceMethod.__setitem__hsGAv000v#x(%dmmTYYDF  " "6 *)rN)r r!r"rrLr3rrrr:r:Xs&+rr:ceZdZdZdZy)_DictKeyAndValuec||_yr)dict)r rRs rrz_DictKeyAndValue.__init__ps  rc|dvr td|r||_n||_t|dr1t|dr$|j|j|j<yyy)N)rrz6DictKeyAndValue should only ever be called with 0 or 1rvalue) RuntimeErrorrTrhasattrrRr0s rr3z_DictKeyAndValue.__setitem__ssW F?WX X DJDH 4 GD'$:"&**DIIdhh %; rN)r r!r"rr3rrrrPrPos -rrPceZdZdZy) _Dereferencec<tj|||_yr)rrid)r rZs rrz_Dereference.__init__s$rN)r r!r"rrrrrXrX~srrX)Deferredc"eZdZdZdZdZdZy)_Defercxtj|tj||jyr)r[rrpauser s rrz_Defer.__init__s'$$ rrc|jrtdj||d|_|j|y)Nz8setitem should only be called once, setting {!r} to {!r}r)wassetrUformatcallbackr0s rr3z_Defer.__setitem__s> ;;JQQs  DK crctj||||j|j}|j |yr)rrunpauseresultr)r deprresovds rrz_Defer.addDependants6 dC-  v&rN)r r!r"rrar3rrrrr]r]s F 'rr]N)r4twisted.pythonrrtwisted.python.compatrrr$r6r:rPrXtwisted.internet.deferr[objectr]rrrrmsq (2==*"C"CJ ,Z ,+h+. - -8 ,'Xf x'r