Beispiel #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)
Beispiel #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)
Beispiel #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)
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
Beispiel #5
0
def handler(methodName, *args, **kwargs):
    method = getattr(getSiteManager(), methodName)
    method(*args, **kwargs)
Beispiel #6
0
def handler(methodName, *args, **kwargs):
    method = getattr(getSiteManager(), methodName)
    method(*args, **kwargs)
 def _callFUT(self, *args, **kw):
     from zope.component._api import getSiteManager
     return getSiteManager(*args, **kw)
Beispiel #8
0
 def _callFUT(self, *args, **kw):
     from zope.component._api import getSiteManager
     return getSiteManager(*args, **kw)