How can I get all registered browser:resource and browser:resourceDirectory from the component registry?
I looked in different places trying to figure out which components are created by the zcml browser:resource directive and found Products.Five.browser.metaconfigure with a call to registerAdapter :
handler('registerAdapter', factory, (layer,), Interface, name, _context.info)
This means that it will register an adapter that requires (layer,) and provides an Interface , but calling the following does not work (it returns a component that is not a browser resource):
from zope.publisher.interfaces.browser import IDefaultBrowserLayer zope.component.getAdapters((IDefaultBrowserLayer,), Interface)
I'm not sure, but it seems that getAdapters needs an instance. I do not want to request zope.component, but to register registered adapters.
I found a lookupAll(required, provided) method in zope.interface.interfaces that looks the way I want, but I could not find where it was implemented, so I donβt know what to call it.
source share