Skip to content

Commit

Permalink
Use newer registration apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Apr 2, 2006
1 parent 405ed8e commit 437b3d5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions component.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ def getFactories(iface):
"""Return the factory registrations, who will return objects providing this
interface."""
gsm = zapi.getGlobalSiteManager()
for reg in gsm.registrations():
if not isinstance(reg, UtilityRegistration):
continue
for reg in gsm.registeredUtilities():
if reg.provided is not IFactory:
continue
interfaces = reg.component.getInterfaces()
Expand All @@ -133,9 +131,7 @@ def getFactories(iface):
def getUtilities(iface):
"""Return all utility registrations that provide the interface."""
gsm = zapi.getGlobalSiteManager()
for reg in gsm.registrations():
if not isinstance(reg, UtilityRegistration):
continue
for reg in gsm.registeredUtilities():
if reg.provided.isOrExtends(iface):
yield reg

Expand Down

0 comments on commit 437b3d5

Please sign in to comment.