mò ‹ã¸Ec@sTdZeZdklZdklZlZlZdk l Z dk l Z dk Z defd„ƒYZdfd „ƒYZd fd „ƒYZd fd „ƒYZdeefd„ƒYZdeefd„ƒYZdefd„ƒYZdfd„ƒYZdfd„ƒYZeƒZd„Zdefd„ƒYZdefd„ƒYZdS(sPersistent Classes.(s implements(sUPTODATEsCHANGEDsGHOST(s IPersistent(sPersistentFunctionNtSimpleDescriptorcBs5tZeƒZd„Zd„Zd„Zd„ZRS(NcCs ||_dS(N(tvaluetselft_value(RR((t./data/zmath/zope/lib/python/zodbcode/class_.pyt__init__!scCs$|i|ijo t‚n|iS(N(RRtmissingtAttributeError(Rtobjtcls((Rt__get__$s cCs ||_dS(N(RRR(RRR((Rt__set__)scCs'|i|ijo t‚n|`dS(N(RRRR(RR((Rt __delete__,s (t__name__t __module__tobjectRRR R R (((RRs     t ExtClassDescrcBsMtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(s=Maintains seperate class and instance descriptors for an attribute. This allows a class to provide methods and attributes without intefering with normal use of instances. The class and its instances can each have methods with the same name. This does interfere with introspection on the class. cCs||_||_dS(N(tnameRt instdescr(RRR((RR;s cCs5|djo|i|ƒSn|ii||ƒSdS(N(RtNoneRtclsgetR RR (RRR ((RR ?s cCsX|djo|i|ƒn7|idjot|iƒ‚n|ii||ƒSdS(N( RRRtclssettvalRRRR (RRR((RR Es  cCs3|idjot|iƒ‚n|ii|ƒS(N(RRRRRR R(RR((RR MscCsdS(N((RR ((RRTscCsdS(N((RR((RRWscCsdS(N((R((Rt clsdeleteZs( R Rt__doc__RR R R RRR(((RR1s       t MethodMixincBstZd„Zd„ZRS(NcCsFt|dƒpt|ƒ}ntt|ƒi||ƒ||_dS(NR ( thasattrtdescrRtsuperRRRRtfunc(RRRR((RR_scs‡‡d†}|S(NcsLyˆiˆ||ŽSWn.tj o"ˆi Gˆ G| G| GH‚nXdS(N(RRR targstkwargst TypeError(RR(R R(Rtfhs (R!(RR R!((RR RRgs(R RRR(((RR]s t DataMixincBs,tZd„Zd„Zd„Zd„ZRS(NcCsFt|dƒpt|ƒ}ntt|ƒi||ƒ||_dS(NR ( RRRRR"RRRR(RRRR((RRrscCs|iS(N(RR(RR ((RRzscCs ||_dS(N(RR(RR((RR}scCs |`dS(N(RR(R((RR€s(R RRRRR(((RR"ps   tExtClassMethodDescrcBstZRS(N(R R(((RR#ƒstExtClassDataDescrcBstZRS(N(R R(((RR$†stExtClassHookDataDescrcBstZd„Zd„ZRS(NcCs)tt|ƒi|||ƒ||_dS(N(RR%RRRRRthook(RRRRR&((RRŒscCs||_|iƒdS(N(RRR&(RR((RRs (R RRR(((RR%‰s tPersistentMethodcBs)tZdZd„Zd„Zd„ZRS(s&Make PersistentFunctions into methods.cCs||_||_||_dS(N(tklassRtim_classtinsttim_selfRtim_func(RR(R*R((RR™s  cCsD|idjo d}nd|if}||ii|iifS(Ns!s'(RR+RtfmtR)R R,(RR-((Rt__repr__žs cOs{|idjoQt|d|iƒp6td|ii|iit |dƒifƒ‚qwn|i|i||ŽSdS(NisVunbound method %s() must be called with %s instance as first argument (got %s instead)( RR+Rt isinstanceRR)R R,R ttypeR(RRR((Rt__call__¥s:(R RRRR.R1(((RR'—s   tPersistentDescriptorcBs&tZd„Zd„Zdd„ZRS(NcCsF|i|_|i|_||_||_|i|_|i|_dS(N( RR RRtobjclasst __objclass__t_funct __getstate__t __setstate__(RR3R((RR²s      cCsd|ii|ifS(Ns(RR4R (R((RR.½scCsO|djo!t|p|id|iƒSnt|p|i||iƒSdS(N(RRR'R(RR4R5(RRR(((RR Ás  (R RRR.RR (((RR2°s cCsBx;|iD]0}|ii|tƒ}|tj o|Sq q W|S(s!Walk the mro of cls to find attr.N( R t__mro__tct__dict__tgettattrt_missingtotdefault(R R<R?R9R>((RtfindattrÌs   tStateChangeDataDescrcBstZRS(N(R R(((RRAÔstPersistentClassMetaClasscBsttZeZed„Zd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „ZRS( Nc sid|jo |d=ntt|ƒi||||ƒ‰tˆ_ ‡d†}‡d†}|ddƒ|dt i ƒdƒ|d|ƒ|ddƒ|d |iƒ|d |iƒtˆd dƒ}tˆd td |dtˆd ƒƒƒxG|iƒD]9\} } t| tƒotˆ| tˆ| ƒƒqÿqÿW|d |iƒ|d |iƒtˆ_ ˆS(NR:cs5tˆ|tiƒ}tˆ|t|||ƒƒdS(N( R@R R<RRtprevtsetattrR$tv(R<RERC(R (Rt extend_attrüscs5tˆ|tiƒ}tˆ|t|||ƒƒdS(N( R@R R<RRRCRDR#tm(R<RGRC(R (Rt extend_methst_p_oidt_p_atimei€Qt_p_statet _p_changedt _p_activatet _p_deactivatet_p_jarR6R7(tdictRRBtmetat__new__RtbasesR tFalset_pc_initRFRHRttimetstateRMRNR@tinst_jar_descrRDR%tgetattrtitemstkRER/tPersistentFunctionR2R6R7tTrue( RQRRSRPRWRHRFR RXR[RE((R RRRós0  !         ! cCs±tt|ƒi}|dƒp||ƒSn|ddjp.|idƒp|idƒp |dj o;|itjo'|i ƒt t i ƒdƒ|_ q§n||ƒS(NRUit_t_p_t_pc_R:i€Q( RRBR t__getattribute__t super_methRt startswithRKtGHOSTRMtintRVRJ(R RRb((RRa"s ? !cCs“|idƒ oe|io[|ii|ƒ}|dj o8t|ddƒ}|dj o|d|ƒdSqrqvnt t |ƒi ||ƒdS(NR`R (R<RcR RUR:R;RRRYtsetRRRBt __setattr__(R R<RRfR((RRg5s   cCs2|idƒodSntt|ƒi|ƒdS(NR_(R<RcRRBR t __delattr__(R R<((RRh@scCsd|i|ifS(Ns(R RR (R ((RR.FscCs»h}x®|iiƒD]}t||ƒ}t|tƒo|i ||