Skip to content

Commit

Permalink
Updated to reflect new regesistration objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Mar 1, 2006
1 parent a240f41 commit 0fd1133
Show file tree
Hide file tree
Showing 3 changed files with 427 additions and 4 deletions.
14 changes: 11 additions & 3 deletions component.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
import types

from zope.component.interfaces import IFactory
from zope.component.site import AdapterRegistration, SubscriptionRegistration
from zope.component.components import (
AdapterRegistration,
SubscriptionRegistration,
HandlerRegistration,
)

from zope.component.site import UtilityRegistration
from zope.interface import Interface
from zope.interface.interface import InterfaceClass
Expand All @@ -42,7 +47,10 @@ def getRequiredAdapters(iface, withViews=False):
gsm = zapi.getGlobalSiteManager()
for reg in gsm.registrations():
# Only get adapters
if not isinstance(reg, (AdapterRegistration, SubscriptionRegistration)):
if not isinstance(reg, (AdapterRegistration,
SubscriptionRegistration,
HandlerRegistration),
):
continue
# Ignore adapters that have no required interfaces
if len(reg.required) == 0:
Expand Down Expand Up @@ -193,7 +201,7 @@ def getAdapterInfoDictionary(reg):
'required': [getInterfaceInfoDictionary(iface)
for iface in reg.required
if iface is not None],
'name': getattr(reg, 'name', _('<subscription>')),
'name': getattr(reg, 'name', ''),
'factory': path,
'factory_url': url,
'doc': doc,
Expand Down
Loading

0 comments on commit 0fd1133

Please sign in to comment.