mò ¥%ÜGc@s¤dkZdkZdkZdkZdkZdkZdkZydkZdkZWn%e j odk Zdk ZnXdk Tdk Z y eZWneiZnXd„Zd„Zd„Zdefd„ƒYZd„Zdefd „ƒYZd efd „ƒYZd efd „ƒYZdefd„ƒYZdefd„ƒYZdeifd„ƒYZdefd„ƒYZdefd„ƒYZd„Z dS(N(t*cCsJ|djodSnt|tƒ ot|tƒ o |gSn|SdS(N(txtNonet isinstancetlistttuple(R((t3/home/holguin2/public_html/spyce/sqlalchemy/util.pytto_lists  " cCsD|djo tƒSnt|tƒptt|ƒƒSn|SdS(N(RRtSetRR(R((Rtto_sets   cs2ytiˆƒSWn‡d†}|ƒSnXdS(Nc#sDtˆƒd}x$|djoˆ|V|d8}qWtƒ‚dS(Nii(tlentseqtit StopIteration(R (R (Rtrev*s  (t __builtin__treversedR R(R R((R RR&s  t ArgSingletoncBstZhZd„ZRS(NcGsX||f}yti|SWn6tj o*ti||Œ}|ti|<|SnXdS(N( tselftargsthashkeyRt instancestKeyErrorttypet__call__tinstance(RRRR((RR4s  (t__name__t __module__RR(((RR2scCspg}xc|iD]X}|i}t|dƒo9x6|iiD]$}|djo|i |ƒq<q<WqqW|S(s5return the full set of legal kwargs for the given clst func_codeRN( tkwtclst__mro__tct__init__tconsthasattrRt co_varnamestvntappend(RR R"R%R((Rtget_cls_kwargs=s    tSimplePropertycBs2tZdZd„Zd„Zd„Zd„ZRS(sa "default" property accessor.cCs ||_dS(N(tkeyR(RR)((RR!JscCst||i|ƒdS(N(tsetattrtobjRR)tvalue(RR+R,((Rt__set__LscCst||iƒdS(N(tdelattrR+RR)(RR+((Rt __delete__NscCs)|djo|Snt||iƒSdS(N(R+RRtgetattrR)(RR+towner((Rt__get__Ps (RRt__doc__R!R-R/R2(((RR(Hs    tOrderedPropertiescBstZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z e d „Zd „Zd „Zd„ZRS(sk An object that maintains the order in which attributes are set upon it. also provides an iterator and a very basic getitem/setitem interface to those attributes. (Not really a dict, since it iterates over values, not keys. Not really a list, either, since each value must have a key associated; hence there is no append or extend.) cCstƒ|idR?R@RARCRDRRGRHRERI(((RR4Vs              R6cBs‰tZdZed„Zd„Zd„Zed„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „ZRS(sHA Dictionary that returns keys/values/items in the order they were addedcKsg|_|i||dS(N(Rt_listtupdatetdtkwargs(RRLRM((RR!„s cCs t|iƒS(N(RRRJ(R((RRH‡scCsg|_ti|ƒdS(N(RRJtdictRI(R((RRI‰s cKst|oQt|dƒo|iƒ}n|}x(|D]\}}|i||ƒq4Wn|o|i |ƒndS(Nt iteritems( RLR#ROR R)R,RR>RMRK(RRLRMR R,R)((RRKŒs cCs9|i|ƒp|i||ƒ|Sn|i|ƒSdS(N(RRER)R>R,R?(RR)R,((Rt setdefault—scCs&g}|iD]}|||q~S(N(t_[1]RRJR)(RRQR)((RtvaluesscCs t|iƒS(N(titerRRJ(R((RR:ŸscCs,tg}|iD]}|||q~ƒS(N(RSRQRRJR)(RRQR)((RR9¡scCs |iƒS(N(RR:(R((Rtiterkeys£scCs5tg}|iƒD]}||||fq~ƒS(N(RSRQRRHR)(RRQR)((RRO¥scCsPy|i|ii|ƒ=Wntj ot|ƒ‚nXti||ƒdS(N(RRJtindexR)t ValueErrorRRNR@(RR)((RR@§s cCs;|i|ƒp|ii|ƒnti|||ƒdS(N(RRER)RJR&RNR>R=(RR)R=((RR>­scCsti||ƒS(N(RNR?RR)(RR)((RR?±s(RRR3RR!RHRIRKRPRRR:R9RTROR@R>R?(((RR6‚s            t ThreadLocalcBs2tZdZd„Zd„Zd„Zd„ZRS(sXan object in which attribute access occurs only within the context of the current threadcCsh|idtZdZed„Zd„Zd„Zd„Zd„ZRS(s¢a Registry that can store one or multiple instances of a single class on a per-thread scoped basis, or on a customized scope createfunc - a callable that returns a new object to be placed in the registry scopefunc - a callable that will return a key to store/retrieve an object, defaults to thread.get_ident for thread-local objects. use a value like lambda: True for application scope. cCs<||_|djoti|_n ||_h|_dS(N(t createfuncRt scopefuncRRYRZtregistry(RRkRl((RR!îs    cCsN|iƒ}y|i|SWn,tj o |ii||iƒƒSnXdS(N(Rt_get_keyR)RmRRPRk(RR)((RRõs  cCs||i|iƒ