ó ¿œ^c@s€dZddlZdd d„ƒYZdd d„ƒYZddd„ƒYZed diƒZd „Zed kr|eƒndS(s?Generic metaclass. XXX This is very much a work in progress. iÿÿÿÿNtMetaMethodWrappercBseZd„Zd„ZRS(cCs%||_||_|jj|_dS(N(tfunctinstt__name__(tselfRR((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyt__init__ s  cOst|j|jf||ƒS(N(tapplyRR(Rtargstkw((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyt__call__s(Rt __module__RR (((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyR s t MetaHelpercBs eZeZd„Zd„ZRS(cCs ||_dS(N(t__formalclass__(Rt formalclass((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyt__helperinit__scCs–y|jj|ƒ}WnTtk rly|jjdƒ}Wn ttfk r^t|‚nX|||ƒSXt|ƒtjkr†|S|j||ƒS(Nt__usergetattr__(R t __getattr__tAttributeErrortKeyErrorttypettypest FunctionTypet__methodwrapper__(Rtnametrawtga((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyRs  (RR RRRR(((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyR s t MetaClasscBs>eZdZeZdZd„Zd„Zd„Zd„Z RS(scA generic metaclass. This can be subclassed to implement various kinds of meta-behavior. icCs[y|d}Wntk r!nX||d<|d=||_||_||_d|_dS(NRRi(RRt __bases__t __realdict__t_MetaClass__inited(RRtbasestdictR((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyR4s     cCsiy|j|SWnStk rdx6|jD]+}y|j|ƒSWq)tk rSq)Xq)Wt|‚nXdS(N(RRRRR(RRtbase((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyRAs  cCs*|js||j|Xt(t __helper__RRRR(RRRRtinit((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyR Rs    ( RR t__doc__R R'RRRR#R (((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyR(s tMetacCsidtfd„ƒY}|GH|ƒ}|GH|jdƒd|fd„ƒY}|ƒ}|jGH|jGHdS(NtCcBseZd„Zd„ZRS(cWs dG|GHdS(Ns__init__, args =((RR((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyRbscSsd|fGHdS(Nsm1(x=%r)((Rtx((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pytm1ds(RR RR-(((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyR+as i tDcBseZd„ZRS(cSs$|d dkrt|‚nd|S(Nit__s getattr:%s(R(RR((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyRks (RR R(((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyR.js(R*R-tfoot_foo(R+R,R.((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyt_test`s   t__main__(((((R)RRR RR*R2R(((s-/usr/lib64/python2.7/Demo/metaclasses/Meta.pyts  5