[Zope3-checkins] CVS: Zope3/src/zope/component - utility.py:1.13
Stephan Richter
srichter at cosmos.phy.tufts.edu
Sat Apr 17 10:33:55 EDT 2004
Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv17084/src/zope/component
Modified Files:
utility.py
Log Message:
Get rid of getRegisteredMatching().
Improve UtilityRegistration constructor.
Renamed IComponentRegistry to IRegistry.
=== Zope3/src/zope/component/utility.py 1.12 => 1.13 ===
--- Zope3/src/zope/component/utility.py:1.12 Thu Apr 15 11:29:46 2004
+++ Zope3/src/zope/component/utility.py Sat Apr 17 10:33:54 2004
@@ -15,14 +15,13 @@
$Id$
"""
-
from zope.component.exceptions import Invalid, ComponentLookupError
-from zope.component.interfaces import IUtilityService, IComponentRegistry
+from zope.component.interfaces import IUtilityService, IRegistry
from zope.component.service import GlobalService
from zope.interface.adapter import AdapterRegistry
import zope.interface
-class IGlobalUtilityService(IUtilityService, IComponentRegistry):
+class IGlobalUtilityService(IUtilityService, IRegistry):
def provideUtility(providedInterface, component, name=''):
"""Provide a utility
@@ -81,29 +80,13 @@
def registrations(self):
return self._registrations.itervalues()
-
- def getRegisteredMatching(self, interface=None, name=None):
- # doomed lame depreceated method
- lameresult = []
- for registration in self.registrations():
- if (interface is not None
- and interface is not registration.provided):
- continue
- if (name is not None
- and registration.name.find(name) < 0):
- continue
- lameresult.append((registration.provided, registration.name,
- registration.component))
- return lameresult
class UtilityRegistration(object):
def __init__(self, provided, name, component, doc):
- self.provided = provided
- self.name = name
- self.component = component
- self.doc = doc
+ (self.provided, self.name, self.component, self.doc
+ ) = provided, name, component, doc
def __repr__(self):
return '%s(%r, %r, %r, %r)' % (
More information about the Zope3-Checkins
mailing list