[Zope3-checkins] CVS: Zope3/src/zope/component - __init__.py:1.31

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Apr 24 19:20:35 EDT 2004


Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv30851/src/zope/component

Modified Files:
	__init__.py 
Log Message:


Use Utilities servicename instead of a string directly.




=== Zope3/src/zope/component/__init__.py 1.30 => 1.31 ===
--- Zope3/src/zope/component/__init__.py:1.30	Tue Apr 20 07:01:09 2004
+++ Zope3/src/zope/component/__init__.py	Sat Apr 24 19:20:34 2004
@@ -21,7 +21,7 @@
 from zope.component.interfaces import IComponentArchitecture, IFactory
 from zope.component.exceptions import ComponentLookupError
 from zope.component.service import serviceManager
-from zope.component.servicenames import Adapters, Presentation
+from zope.component.servicenames import Adapters, Presentation, Utilities
 
 # Try to be hookable. Do so in a try/except to avoid a hard dependence
 try:
@@ -50,14 +50,14 @@
 # Utility service
 
 def getUtility(context, interface, name=''):
-    return getService(context, 'Utilities').getUtility(interface, name)
+    return getService(context, Utilities).getUtility(interface, name)
 
 def queryUtility(context, interface, default=None, name=''):
-    return getService(context, 'Utilities').queryUtility(
+    return getService(context, Utilities).queryUtility(
         interface, default, name)
 
 def getUtilitiesFor(context, interface):
-    return getService(context, 'Utilities').getUtilitiesFor(interface)
+    return getService(context, Utilities).getUtilitiesFor(interface)
 
 # Adapter service
 
@@ -174,7 +174,7 @@
     return getUtility(context, IFactory, name).getInterfaces()
 
 def getFactoriesFor(context, interface):
-    utils = getService(context, 'Utilities')
+    utils = getService(context, Utilities)
     for (name, factory) in utils.getUtilitiesFor(IFactory):
         interfaces = factory.getInterfaces()
         try:




More information about the Zope3-Checkins mailing list