mò #á¸Ec@sádZdkZdklZdklZdklZdkl Z lZl Z dZ dk l Z lZhZd„Zeid „Zdd „Zd „Zdd „Zdd „Zd„Zd„Zdd„Zdd„ZdS(sxImplemantation assertion facilities. Revision information: $Id: Implements.py 40218 2005-11-18 14:39:19Z andreasjung $ N(s ClassType(s verifyClass(s Interface(s TupleTypes ClassTypes StringTypei(s ClassTypess isInstancecCsct|ƒ}|tjot|dƒo |iSqSnt|dƒo |iSnti|dƒS(Nt__class_implements__t__implements__( ttypetobjectttt ClassTypesthasattrRRt_typeImplementstgettNone(RR((t3/data/zmath/zope/lib/python/Interface/Implements.pyt getImplements"s   cCsGt|ƒtjo#t|dƒo |iSqCdSn||dƒSdS(NR(RtklassRRRR ttiget(R R ((R tgetImplementsOfInstances-s  cCsÅt|ddƒ}|tjpt|tƒo||ƒSn…|tjoQt|ddƒ}|dj o.t |ƒ}|ot ||||ƒSq—qÁn'|tjpt|ƒtjoH|dj o7|||ƒ}|dj ot ||||ƒSqÿqÁn¿|tjpt|ƒtjo9x›|D]*}t ||||ƒ}|o|Sq*q*Wnf|dj o<t|ƒ|jo)tidt|ƒi|ifƒ‚ntidt|ƒiƒ‚dS(sñ Visits the interfaces described by an __implements__ attribute, invoking the visitor for each interface object. If the visitor returns anything true, the loop stops. This does not, and should not, visit superinterfaces. t __class__s^__implements__ should be an interface or tuple, not a %s pretending to be a %ssD__implements__ should be an interface or tuple, not a %siN(tgetattrt implementsR timplements_classtInterfaceClasst isInstancetvisitortCLASS_INTERFACESRR RtitvisitImplementst getInterfacet StringTypeRt TupleTypetrt Exceptionst BadImplementst__name__(RRRRRRR R((R R7s2        )cCs|t|