mς γΈEc@sπdZdklZlZdklZdklZdkl Z dk l Z l Z dk lZlZdklZd„Zd efd „ƒYZd fd „ƒYZd kZdklZlZdklZlZlZd„Zd„Zd S(sCLocal sites $Id: localsite.py 71269 2006-11-22 13:37:06Z yuppie $ (sISites IPossibleSite(sgetGlobalSiteManager(s implements(sInterfaceClass(s aq_parentsaq_inner(sIFiveSiteManagersIFiveUtilityRegistry(sxorcCs,tt||ƒ|ƒo|o |o| S(N(txortatbtc(RRR((t;/data/zmath/zope/lib/python/Products/Five/site/localsite.pyt one_of_threes tFiveSiteManagercBs«tZeeƒd„Zed„ƒZed„ƒZed„ƒZed„ƒZ dd„Z dd„Z d„Z d „Zd dd „Zd „Zd „Zd„ZRS(NcCs'||_|_tidtdƒdS(NsaThe FiveSiteManager is deprecated and will be removed in Zope 2.12. See Five/doc/localsite.txt .i(tcontexttselft __parent__twarningstwarntDeprecationWarning(RR((Rt__init__)s cCs+|i}|djotƒfSn|fS(N(RtnexttNonetgetGlobalSiteManager(RR((Rt __bases__1s  cCsR|i}xB|dj o4tt|ƒƒ}ti|ƒo|iƒSq q WdS(N( RRtobjRt aq_parenttaq_innertISitet providedBytgetSiteManager(RR((RR8s  cCs*|i}|djo tƒ}n|iS(N(RRRRtadapters(RR((RRFs   cCs t|iƒS(N(tIFiveUtilityRegistryRR(R((Rt utilitiesMscCs|ii||||ƒS(N(RRt queryAdaptertobjectt interfacetnametdefault(RRRRR((RRQscCs|ii||||ƒS(N(RRtqueryMultiAdaptertobjectsRRR(RR!RRR((RR TscCs3|i}|djo tƒ}n|i||ƒS(N(RRRRt getAdaptersR!tprovided(RR!R#R((RR"Ws   cCs|ii||ƒS(N(RRt subscriberstrequiredR#(RR%R#((RR$]stcCs|ii|||ƒS(N(RRt queryUtilityRRR(RRRR((RR'`scCs|ii|ƒS(N(RRtgetUtilitiesForR(RR((RR(cscCs|ii|ƒS(N(RRtgetAllUtilitiesRegisteredForR(RR((RR)fsc Os|iddƒ}|iddƒ}|iddƒ}|iddƒ}|iddƒ}d}d} t |ƒdjo0t |dt ƒo|d}q©|d} nt |ƒdjo0t |dt ƒo|d}qμ|d} nt |ƒd jo%|otd ƒ‚q$|d }nt|dj |dj |dj ƒptd ƒ‚n|djo |}n|djo |}nt| dj |dj |dj ƒptd ƒ‚n| djo |} n| djo |} n|ii|| |ƒS( NRuRR#tutilityt componentiiisYou can only provide one names*You can specify one and only one interface(tkwtgetRRt interface_kwt provided_kwt utility_kwt component_kwRR*tlentargst isinstancetInterfaceClasst TypeErrorRRRtregisterUtility( RR3R,RR/R.R0RR1R*((RR7isH            (t__name__t __module__t implementstIFiveSiteManagerR tpropertyRRRRRRR R"R$R'R(R)R7(((RR&s        tFiveSitecBs$tZeeƒd„Zd„ZRS(NcCs t|ƒS(N(RR(R((RR scCstdƒ‚dS(Ns#This class has a fixed site manager(tNotImplementedError(Rtsm((RtsetSiteManager£s(R8R9R:t IPossibleSiteRR@(((RR=s  N(s enableSites disableSite(ssetSites clearSitessetHookscCsKtidtdƒt|ƒt|ƒ}|i|ƒt|ƒt ƒdS(NseThe enableLocalSiteHook is deprecated and will be removed in Zope 2.12. See Five/doc/localsite.txt .i( R R R t enableSiteRRt componentsR@tsetSitetsetHooks(RRC((RtenableLocalSiteHook­s      cCs"t|ƒtƒ|idƒdS(s3Remove __before_traverse__ hook for Local Site N(t disableSiteRt clearSiteR@R(R((RtdisableLocalSiteHook·s ( t__doc__tzope.app.component.interfacesRRAtzope.componentRtzope.interfaceR:tzope.interface.interfaceR5t AcquisitionRRtProducts.Five.site.interfacesR;RtoperatorRRRRR=R tProducts.Five.componentRBRGtzope.app.component.hooksRDRHRERFRI(R=RRRGRARR5RR RR;RRR:RERBRHRDRFRRI((Rt?s     w