[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/services - configuration.py:1.10 service.py:1.12

Jim Fulton jim@zope.com
Mon, 24 Mar 2003 06:10:10 -0500


Update of /cvs-repository/Zope3/src/zope/app/interfaces/services
In directory cvs.zope.org:/tmp/cvs-serv21429/src/zope/app/interfaces/services

Modified Files:
	configuration.py service.py 
Log Message:
Fixed a bug in configuration handling.

You should (and now do) get an error if you try to register a
configuration and there is no *local*, meaning in this site, service
to register with.  You now get an understandable (I hope) error
telling you to add a local service.


=== Zope3/src/zope/app/interfaces/services/configuration.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/interfaces/services/configuration.py:1.9	Sun Mar 23 14:24:45 2003
+++ Zope3/src/zope/app/interfaces/services/configuration.py	Mon Mar 24 06:09:39 2003
@@ -36,6 +36,19 @@
     __implements__ = IConfigurationStatus
     allowed_values = Unregistered, Registered, Active
 
+class INoLocalServiceError(Interface):
+    """No local service to configure
+    """
+
+class NoLocalServiceError(Exception):
+    """No local service to configure
+
+    An attempt was made to register a configuration for which there is
+    no local service.
+    """
+
+    __implements__ = INoLocalServiceError
+
 class IConfiguration(Interface):
     """Configuration object
 


=== Zope3/src/zope/app/interfaces/services/service.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/interfaces/services/service.py:1.11	Sun Mar 23 11:45:44 2003
+++ Zope3/src/zope/app/interfaces/services/service.py	Mon Mar 24 06:09:39 2003
@@ -117,6 +117,14 @@
     services.
     """
 
+    def queryLocalService(service_type, default=None):
+        """Return a local service, if there is one
+
+        A local service is one configured in the local service manager.
+
+        The service must be returned in the context of the service manager.
+        """
+
 class IServiceConfiguration(configuration.INamedComponentConfiguration):
     """Service Configuration