Ejemplo n.º 1
0
async def dispatch(*event):
    try:
        sitemanager = getSiteManager()
    except ComponentLookupError:
        # Oh blast, no site manager. This should *never* happen!
        return []

    return await sitemanager.adapters.asubscribers(event, None)
Ejemplo n.º 2
0
async def object_event_notify(event):
    """Dispatch ObjectEvents to interested adapters."""
    try:
        sitemanager = getSiteManager()
    except ComponentLookupError:
        # Oh blast, no site manager. This should *never* happen!
        return []

    return await sitemanager.adapters.asubscribers((event.object, event), None)
Ejemplo n.º 3
0
async def object_event_notify(event):
    """Dispatch ObjectEvents to interested adapters."""
    try:
        sitemanager = getSiteManager()
    except ComponentLookupError:
        # Oh blast, no site manager. This should *never* happen!
        return []

    return await sitemanager.adapters.asubscribers((event.object, event), None)
Ejemplo n.º 4
0
def searchInterfaceUtilities(context, search_string=None, base=None):
    site_man = getSiteManager()
    iface_utilities = site_man.getUtilitiesFor(IInterface)

    if search_string:
        search_string = search_string.lower()
        iface_utilities = [
            iface_util for iface_util in iface_utilities
            if (getInterfaceAllDocs(iface_util[1]).find(search_string) >= 0)
        ]
    if base:
        res = [
            iface_util for iface_util in iface_utilities
            if iface_util[1].isOrExtends(base)
        ]
    else:
        res = list(iface_utilities)
    return res
Ejemplo n.º 5
0
def handler(methodName, *args, **kwargs):
    method = getattr(getSiteManager(), methodName)
    method(*args, **kwargs)
Ejemplo n.º 6
0
def handler(methodName, *args, **kwargs):
    method = getattr(getSiteManager(), methodName)
    method(*args, **kwargs)
Ejemplo n.º 7
0
 def _callFUT(self, *args, **kw):
     from zope.component._api import getSiteManager
     return getSiteManager(*args, **kw)
Ejemplo n.º 8
0
 def _callFUT(self, *args, **kw):
     from zope.component._api import getSiteManager
     return getSiteManager(*args, **kw)