3 ,W @sdZddlmZddlmZddlmZddlmZddl m Z ddZ Gd d d eZ eeGd d d eZ e d ZyddlmZWnek rYnXedd[eZddZde fddZdde fddZdddZdddZdS)zGlobal components support ) implementer)AdapterRegistry) Components)IComponentLookup)_BLANKcCs t||S)N)getattr)Z componentsZ registryNamer$/usr/lib/python3.6/globalregistry.pyGARsr cs(eZdZdZfddZddZZS)GlobalAdapterRegistryz~A global adapter registry This adapter registry's main purpose is to be picklable in combination with a site manager.cs||_||_tt|jdS)N) __parent____name__superr __init__)selfparentname) __class__rr r szGlobalAdapterRegistry.__init__cCst|j|jffS)N)r r r )rrrr __reduce__%sz GlobalAdapterRegistry.__reduce__)r __module__ __qualname____doc__rr __classcell__rr)rr r s r c@seZdZddZddZdS)BaseGlobalComponentscCst|d|_t|d|_dS)Nadapters utilities)r rr)rrrr _init_registries+s z%BaseGlobalComponents._init_registriescCs|jS)N)r )rrrr r/szBaseGlobalComponents.__reduce__N)r rrrrrrrr r(srbase) addCleanUpcCs tjdS)Nr)rrrrrr :srcCstS)N)globalSiteManagerrrrr getGlobalSiteManager>sr!NcCstj|||dddS)NF)event)rZregisterUtility)Z componentprovidesrrrr provideUtilityEsr$cCstj||||dddS)NF)r")rZregisterAdapter)factoryadaptsr#rrrr provideAdapterHsr'cCstj|||dddS)NF)r")rZregisterSubscriptionAdapter)r%r&r#rrr provideSubscriptionAdapterKsr(cCstj||dddS)NF)r")rZregisterHandler)r%r&rrr provideHandlerNsr))NN)N)rZzope.interfacerZzope.interface.adapterrZzope.interface.registryrZzope.component.interfacesrZzope.component._compatrr r rrZzope.testing.cleanupr ImportErrorr r!r$r'r(r)rrrr s,