mò ÿÔ5;c@sWdkZdfd„ƒYZdefd„ƒYZd„Zedjo eƒndS(NtAcquisitionMixincBs,tZdZeZeZd„Zd„ZRS(sŽ Mixin class allowing implicit acquisition of attributes from objects up a containment hierachy. To enable this feature, an object 'b' contained in another object 'a' must set the instance variable b.baseobj to a. The search is done recursively until either an exception is raised by the queried object or the object is found. Attributes that strt with an underscore ('_') can not be acquired. Be careful when acquiring methods: the method will be executed in the baseobjects context, not the one it is acquired into. See the documentation of acquire() for details. cOsJ|iddƒ}|dj o||_|d=nt|i||ƒdS(så Create the object and call startup(*args,**kw) - if you give a keyword 'baseobj' then its parameter is used to set the baseobj for acquisition; the keyword is then deleted from kw tbaseobjN(tkwtgettNoneRtselftapplytstartuptargs(RRRR((tH/data/zmath/lib/python2.4/site-packages/mx/Tools/Examples/Acquisition.pyt__init__s    cOsdS(s- Override this to init the instance. N((RRR((R R*s( t__name__t __module__t__doc__RRtacquiret __getattr__R R(((R Rs  tPythonAcquisitionMixincBs2tZeed„ZeiZeiZeiZRS(NcCs2|ddjo||i|ƒSn||‚dS(Nit_(tnametgetattrRRtAttributeError(RRRR((R R2s( R R RRRRRR R(((R R0s  c CsXdtfd„ƒY}dtfd„ƒY}dtfd„ƒY}|ƒ}|d|ƒ} |d| ƒ}|iG| iG|iGH| iG|iGH|iGHd| _|iG| iG|iGHd |_|iG| iG|iGHHd GHHdk }t d ƒ}dtfd „ƒY}dtfd „ƒY}dtfd„ƒY}|ƒ}|d|ƒ} |d| ƒ}|i ƒ}x#|D]}|i|i|iqlWdG|i ƒ|GdGHdtfd„ƒY}dtfd„ƒY}dtfd„ƒY}|ƒ}|d|ƒ} |d| ƒ}|i ƒ}x#|D]}|i|i|iqWdG|i ƒ|GdGHdS(NtCcBstZdZdZRS(Nii (R R tatx(((R RAstDcBstZdZRS(Ni(R R tb(((R REstEcBstZdZRS(Ni(R R tc(((R RHsRiis Performance:i †cBstZdZRS(Ni (R R R(((R RbscBstZdZRS(Ni(R R ty(((R RescBstZdZRS(Ni(R R tz(((R RhssAcquisitionMixin:tsecondscBstZdZRS(Ni (R R R(((R RwscBstZdZRS(Ni(R R R(((R RzscBstZdZRS(Ni(R R R(((R R}ssPythonAcquisitionMixin:(RRRRRtdteRRttimetrangetltttiRRRR( RRRR%RR#R$R!R R((R t_test?sX           t__main__(tmx.Tools.NewBuiltinstmxRRR&R (RR&RR)((R t?s - M