So, I have this utility function in my codebase that looks something like this:
def getServiceProvider(store, iface):
"""
Retrieve the provider of a particular service interface.
The interface is located as a powerup in the application store.
@param store: the site store, or any substore thereof.
@param iface: the service interface required.
"""
siteStore = store
while siteStore.parent:
siteStore = siteStore.parent
ls = IRealm(siteStore)
la = ls.accountByAddress(u'Fusion', None)
return iface(la)
In case it's not obvious, Fusion is my offering's name. My actual implementation has some caching going on, but that's besides the point; namely, that this sort of functionality should probably be part of Mantissa, and a little less hackish. I'd like to contribute a patch for this, but I'm not sure what form a more generic version of this written for Mantissa would look like, so a few pointers or some discussion about this with someone who has a better idea of what's going on, would be great.