[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/services - module.py:1.1 configuration.py:1.7 service.py:1.9

Guido van Rossum guido@python.org
Thu, 13 Mar 2003 12:11:07 -0500


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

Modified Files:
	configuration.py service.py 
Added Files:
	module.py 
Log Message:
- Remove title and description fields from add_cache.pt (these
  attributes no longer exist on configurations).

- Changed the custom view for adding a connection configuration with
  an add form directive; addconnectionconfig.pt and connection.py in
  zope/app/browser/services bite the dust.

- Change the componentPath attribute to a ComponentPath field; this
  ran into some circularities so we did the following:

- Renamed INameResolver to IModuleService and moved it to its own
  file, zope/app/interfaces/services/module.py.

- Fixed up a few docstrings and comments.



=== Added File Zope3/src/zope/app/interfaces/services/module.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Interfaces needed by the module service.

XXX There is no module service yet; instead, the service manager
currently implements it.  This should change.

$Id: module.py,v 1.1 2003/03/13 17:10:36 gvanrossum Exp $
"""

from zope.interface import Interface

class IModuleService(Interface):
    """Objects that can resolve dotted names to objects
    """

    def resolve(dotted_name):
        """Resolve the given dotted name to a module global variable.

        If the name ends with a trailing dot, the last name segment
        may be repeated.

        If the dotted name cannot be resolved, an ImportError is raised.
        """


=== Zope3/src/zope/app/interfaces/services/configuration.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/interfaces/services/configuration.py:1.6	Mon Mar 10 17:36:40 2003
+++ Zope3/src/zope/app/interfaces/services/configuration.py	Thu Mar 13 12:10:36 2003
@@ -22,6 +22,8 @@
 from zope.app.security.permission import PermissionField
 from zope.app.interfaces.annotation import IAnnotatable
 from zope.app.interfaces.annotation import IAttributeAnnotatable
+from zope.app.interfaces.rdb import IZopeDatabaseAdapter
+from zope.app.services.field import ComponentPath
 
 Unregistered = u'Unregistered'
 Registered = u'Registered'
@@ -71,7 +73,8 @@
     """
 
     name = TextLine(title=u"Name",
-                    description=u"The name that is registered")
+                    description=u"The name that is registered",
+                    required=True, readonly=True, min_length=1)
 
     # The label is generally set as a class attribute on the
     # configuration class.
@@ -88,7 +91,11 @@
     permission = PermissionField(
         title=u"The permission needed to use the component.")
 
-    componentPath = Attribute("The physical path to the component")
+    componentPath = ComponentPath(
+        type=IZopeDatabaseAdapter,
+        title=u"Component path",
+        description=u"The physical path to the component",
+        required=True)
 
 class INamedComponentConfiguration(INamedComponentConfigurationInfo,
                                    INamedConfiguration):


=== Zope3/src/zope/app/interfaces/services/service.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/interfaces/services/service.py:1.8	Tue Mar 11 11:11:09 2003
+++ Zope3/src/zope/app/interfaces/services/service.py	Thu Mar 13 12:10:36 2003
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Interfaces to support service managers.
 
 $Id$
 """
@@ -122,19 +122,6 @@
     """
 
     Packages = Attribute("Package container")
-
-class INameResolver(Interface):
-    """Objects that can resolve dotted names to objects
-    """
-
-    def resolve(dotted_name):
-        """Resolve the given dotted name to a module global variable.
-
-        If the name ends with a trailing dot, the last name segment
-        may be repeated.
-
-        If the dotted name cannot be resolved, an ImportError is raised.
-        """
 
 class IServiceConfiguration(configuration.INamedComponentConfiguration):
     """Service Configuration