3 ,๒ฟWฆ ใ@s8dZddlZddlmZddlmZddlmZddlmZddl m Z dd „Z Gd d „d eƒZ Gd d „d eƒZ Gdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZdd„ZGdd„deƒZee ƒGd d!„d!eƒƒZee eƒGd"d#„d#eƒƒZee ƒd$d%„ƒZd&d'„Zee ƒd(d)„ƒZee ƒd*d+„ƒZGd,d-„d-ƒZdd.lm Z e ed/ƒZ!e!e_"d0d1„Z#ee ƒGd2d3„d3eƒƒZ$e$ƒZ%eeƒGd4d5„d5eƒƒZ&ee ƒGd6d7„d7eƒƒZ'eeƒGd8d9„d9eƒƒZ(e(d:ƒZ)eeƒGd;d<„d„d>eƒZ+dAd?d@„Z,dS)Bz-Examples supporting Sphinx doctest snippets. ้N)ฺ Interface)ฺ implementer)ฺ IInterface)ฺadapter)ฺICcCstjjd|ƒdS)Nz%s )ฺsysฺstdoutฺwrite)ฺxฉr ๚/usr/lib/python3.6/examples.pyr sr c@s eZdZdS)ฺ ITestTypeN)ฺ__name__ฺ __module__ฺ __qualname__r r r r r sr c@s eZdZdS)ฺI1N)rrrr r r r r src@s eZdZdS)ฺI2N)rrrr r r r r#src@s eZdZdS)ฺI3N)rrrr r r r r&src@s eZdZdS)ฺI4N)rrrr r r r r)src@s eZdZdS)ฺIGIN)rrrr r r r r,src@s eZdZdS)ฺIQIN)rrrr r r r r/src@s eZdZdS)ฺISIN)rrrr r r r r2src@s eZdZdS)ฺISIIN)rrrr r r r r5srcGsdS)Nr )ฺargsr r r ฺnoop8src@seZdZdd„Zdd„ZdS)ฺUcCs ||_dS)N)r)ฺselfฺnamer r r ฺ__init__=sz U.__init__cCsd|jj|jfS)Nz%s(%s))ฺ __class__r)rr r r ฺ__repr__@sz U.__repr__N)rrrrr r r r r r;src@s eZdZdS)ฺU1N)rrrr r r r r!Csr!c@s eZdZdS)ฺU12N)rrrr r r r r"Gsr"cCstd|ƒdS)Nz handle1 %s)r )r r r r ฺhandle1Ksr#cGstdt|ƒƒdS)Nzhandle2 )r ฺrepr)Zobjectsr r r ฺhandle2Osr%cCstd|ƒdS)Nz handle3 %s)r )r r r r ฺhandle3Rsr&cCstd|ƒdS)Nz handle4 %s)r )r r r r ฺhandle4Vsr'c@s eZdZdS)ฺGlobalRegistryN)rrrr r r r r(Zsr()ฺGlobalAdapterRegistryฺadapterscCstjtdƒdS)Nr*)ฺbaserr(r r r r ฺ clear_base`sr,c@seZdZdd„ZdS)ฺObcCsdS)Nz r )rr r r r fsz Ob.__repr__N)rrrr r r r r r-dsr-c@seZdZdd„ZdS)ฺOb2cCsdS)Nzr )rr r r r nsz Ob2.__repr__N)rrrr r r r r r.lsr.c@s eZdZdS)ฺOb3N)rrrr r r r r/qsr/c@seZdZdd„ZdS)ฺCompcCs ||_dS)N)ฺcontext)rr1r r r rwsz Comp.__init__N)rrrrr r r r r0usr0้c@seZdZdd„ZdS)ฺComp2cCs ||_dS)N)r1)rr1r r r r~szComp2.__init__N)rrrrr r r r r3|sr3c@s eZdZdZdd„Zdd„ZdS)ฺConformsToIComponentLookupzAAllow a dummy sitemanager to conform/adapt to `IComponentLookup`.cCs ||_dS)N)ฺ sitemanager)rr5r r r r…sz#ConformsToIComponentLookup.__init__cCsddlm}||kr|jSdS)zAThis method is specified by the adapter PEP to do the adaptation.r)ฺIComponentLookupN)Zzope.component.interfacesr6r5)rZ interfacer6r r r ฺ __conform__ˆs z&ConformsToIComponentLookup.__conform__N)rrrฺ__doc__rr7r r r r r4‚sr4cCsJddlm}ddl}ddlm}ddlm}|ƒ|ƒ|d|jƒƒdS)Nr)ฺ XMLConfig)ฺsetUp)ฺtearDownz meta.zcml)Zzope.configuration.xmlconfigr9Zzope.componentZzope.component.testingr:r;Z component)Ztestr9Zzoper:r;r r r ฺ clearZCMLs   r<)N)-r8rZzope.interfacerrZzope.interface.interfacesrZzope.component._declarationrZzope.component.testfiles.viewsrr r rrrrrrrrrฺobjectrr!r"r#r%r&r'r(Zzope.component.globalregistryr)r+r*r,r-ฺobr.r/r0ฺcompr3r4r<r r r r ฺsZ