[Zope3-checkins] CVS: Zope3/src/zope/component - __init__.py:1.4 servicenames.py:1.2

R. Sean Bowman sean.bowman@acm.org
Thu, 6 Feb 2003 01:50:40 -0500


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

Modified Files:
	__init__.py servicenames.py 
Log Message:
finished changing service names to use strings defined in
zope/component/servicenames.py, changed the name of
ErrorReportingService to ErrorReports and Resources to ResourceService


=== Zope3/src/zope/component/__init__.py 1.3 => 1.4 ===
--- Zope3/src/zope/component/__init__.py:1.3	Mon Feb  3 12:43:29 2003
+++ Zope3/src/zope/component/__init__.py	Thu Feb  6 01:50:06 2003
@@ -19,6 +19,8 @@
 from zope.component.interfaces import IComponentArchitecture
 from zope.component.exceptions import ComponentLookupError
 from zope.component.service import serviceManager
+from zope.component.servicenames import Adapters, Skins, ResourceService
+from zope.component.servicenames import Factories
 
 __implements__ = IComponentArchitecture
 
@@ -60,14 +62,14 @@
 def getAdapter(object, interface, name='', context=None):
     if context is None:
         context = object
-    return getService(context, 'Adapters').getAdapter(
+    return getService(context, Adapters).getAdapter(
         object, interface, name)
 
 def queryAdapter(object, interface, default=None, name='', context=None):
     if context is None:
         context = object
     try:
-        adapters = getService(context, 'Adapters')
+        adapters = getService(context, Adapters)
     except ComponentLookupError:
         # Oh blast, no adapter service. We're probably just running from a test
         return default
@@ -78,22 +80,22 @@
 # Factory service
 
 def createObject(context, name, *args, **kwargs):
-    return getService(context, 'Factories').createObject(name, *args, **kwargs)
+    return getService(context, Factories).createObject(name, *args, **kwargs)
 
 def getFactory(context, name):
-    return getService(context, 'Factories').getFactory(name)
+    return getService(context, Factories).getFactory(name)
 
 def queryFactory(context, name, default=None):
-    return getService(context, 'Factories').queryFactory(name, default)
+    return getService(context, Factories).queryFactory(name, default)
 
 def getFactoryInterfaces(context, name):
-    return getService(context, 'Factories').getInterfaces(name)
+    return getService(context, Factories).getInterfaces(name)
 
 # Skin service
 
 def getSkin(wrapped_object, name, view_type):
     return getService(wrapped_object,
-                      'Skins').getSkin(wrapped_object, name, view_type)
+                      Skins).getSkin(wrapped_object, name, view_type)
 
 # View service
 
@@ -128,12 +130,12 @@
 
 def getResource(wrapped_object, name, request):
     return getService(wrapped_object,
-                      'Resources').getResource(
+                      ResourceService).getResource(
         wrapped_object, name, request)
 
 def queryResource(wrapped_object, name, request, default=None):
     return getService(wrapped_object,
-                      'Resources').queryResource(
+                      ResourceService).queryResource(
         wrapped_object, name, request, default)
 
 


=== Zope3/src/zope/component/servicenames.py 1.1 => 1.2 ===
--- Zope3/src/zope/component/servicenames.py:1.1	Wed Feb  5 23:30:59 2003
+++ Zope3/src/zope/component/servicenames.py	Thu Feb  6 01:50:06 2003
@@ -21,3 +21,13 @@
 Events = 'Events'
 Subscription = 'Subscription'
 ErrorReports = 'ErrorReportingService'
+Roles = 'Roles'
+Permissions = 'Permissions'
+Adapters = 'Adapters'
+Authentication = 'Authentication'
+Interfaces = 'Interfaces'
+Utilities = 'Utilities'
+Skins = 'Skins'
+Views = 'Views'
+ResourceService = 'Resources'
+Factories = 'Factories'