mò ÚÅ~Bc@sÂdZydklZWnej o d ZnXdklZhZeiZ dfd„ƒYZ dfd„ƒYZ de fd„ƒYZ ed jo e Z ne Z d „Zee ƒƒd S( sÎ Dynamic pseudo-scoping for Python. Call functions with context.call({key: value}, func); func and functions that it calls will be able to use 'context.get(key)' to retrieve 'value'. This is thread-safe. (slocal(s threadabletContextTrackercBs&tZd„Zd„Zdd„ZRS(NcCstg|_dS(N(tdefaultContextDicttselftcontexts(R((tn/home/radix/Projects/Twisted/branches/releases/twisted-core-2.5.x-2329-2/Twisted.exp/twisted/python/context.pyt__init__scOsV|idiƒ}|i|ƒ|ii|ƒz|||ŽSWd|ii ƒXdS(Niÿÿÿÿ( RRtcopyt newContexttupdatetctxtappendtfunctargstkwtpop(RR R R R R((RtcallWithContext s cCs|idi||ƒS(Niÿÿÿÿ(RRtgettkeytdefault(RRR((Rt getContext)s(t__name__t __module__RRtNoneR(((RRs  t_ThreadedContextTrackercBs/tZd„Zd„Zd„Zdd„ZRS(NcCsti|_h|_dS(N(t threadablet getThreadIDRtthreadIdtcontextPerThread(R((RR.s cCsM|iƒ}y|i|SWn+tj otƒ}|i|<|SnXdS(N(RRttkeyRtKeyErrorRtct(RRR((RtcurrentContext2s  cOs|iƒi||||ŽS(N(RRRR R R R (RR R R R ((RR:scCs|iƒi||ƒS(N(RRRRR(RRR((RR=s(RRRRRRR(((RR-s   t_TLSContextTrackercBstZd„Zd„ZRS(NcCstƒ|_dS(N(tlocalRtstorage(R((RRBscCs?y|iiSWn*tj otƒ}|i_|SnXdS(N(RR"RtAttributeErrorR(RR((RREs (RRRR(((RR As cCs|atiatiadS(N(tctrttheContextTrackerRtcallRR(R$((RtinstallContextTrackerQs  N(t__doc__t threadingR!t ImportErrorRttwisted.pythonRRt __setitem__t setDefaultRRR tThreadedContextTrackerR'( R-R'RR.RRR R!R((Rt?s