[Zope3-checkins] CVS: Zope3/src/zope/component - interfaces.py:1.1.2.2

Jim Fulton jim@zope.com
Mon, 23 Dec 2002 15:18:34 -0500


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

Modified Files:
      Tag: NameGeddon-branch
	interfaces.py 
Log Message:
Got tests passing

=== Zope3/src/zope/component/interfaces.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/component/interfaces.py:1.1.2.1	Mon Dec 23 14:32:40 2002
+++ Zope3/src/zope/component/interfaces.py	Mon Dec 23 15:18:03 2002
@@ -16,94 +16,7 @@
 $Id$
 """
 
-from zope.interface import Interface
-
-class IFactoryService(Interface):
-
-    def createObject(name, *args, **kwargs):
-        """Create a new object using the factory with the given name,
-        passing all remaining arguments to the factory transparently.
-
-        A Zope.ComponentArchitecture.ComponentLookupError will be
-        raised if the factory component can't be found.
-        """
-
-    def getFactory(name):
-        """Return a registered factory
-
-        A Zope.ComponentArchitecture.ComponentLookupError will be
-        raised if the factory component can't be found.
-        """
-
-    def queryFactory(name, default=None):
-        """Return a registered factory
-        """
-
-    def getInterfaces(name):
-        """returns the interface or interface tuple that
-        object instances created by the named factory will implement."""
-    
-
-
-"""Interface for Factory objects."""
-
-
-from zope.interface import Interface
-
-class IFactory(Interface):
-
-    def __call__():
-        """Return an instance of the objects we're a factory for."""
-
-
-    def getInterfaces():
-        """Return the interface(s) that objects created by this factory
-        will implement."""
-
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-
-class IUtilityService(Interface):
-
-    def getUtility(interface, name=''):
-        """Look up a utility that provides an interface.
-
-        If one is not found, raises
-        Zope.ComponentArchitecture.ComponentLookupError.
-
-        """
-
-    def queryUtility(interface, default=None, name=''):
-        """Look up a utility that provides an interface.
-
-        If one is not found, returns default.
-
-        """
-
-
-
-"""
-
-$Id$
-"""
-
-
-
-class IResource(IPresentation):
-    """Resources provide data to be used for presentation.
-    """
-
-
-"""
-
-$Id$
-"""
-from zope.interface import Interface
+from zope.interface import Interface, Attribute
 
 class IComponentArchitecture(Interface):
     """The Component Architecture is defined by six key services,
@@ -252,14 +165,6 @@
         If the component can't be found, the default is returned.
         """
 
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-
 class IServiceService(Interface):
 
     def getServiceDefinitions():
@@ -287,49 +192,59 @@
         """
         
 
+class IFactory(Interface):
 
-"""
-
-$Id$
-"""
+    def __call__():
+        """Return an instance of the objects we're a factory for."""
 
-from zope.interface import Interface
 
-class ISkinService(Interface):
+    def getInterfaces():
+        """Return the interface(s) that objects created by this factory
+        will implement."""
 
-    def getSkin(object, name, view_type):
-        """Return the sequence of layers (names) making up the skin.
+class IFactoryService(Interface):
 
-        The object provides a place to look for placeful skin definitions.
+    def createObject(name, *args, **kwargs):
+        """Create a new object using the factory with the given name,
+        passing all remaining arguments to the factory transparently.
 
-        If the skin was not defined, an empty sequence will be returned.
+        A Zope.ComponentArchitecture.ComponentLookupError will be
+        raised if the factory component can't be found.
         """
 
+    def getFactory(name):
+        """Return a registered factory
 
-"""
+        A Zope.ComponentArchitecture.ComponentLookupError will be
+        raised if the factory component can't be found.
+        """
 
-$Id$
-"""
+    def queryFactory(name, default=None):
+        """Return a registered factory
+        """
 
-from zope.interface import Interface
+    def getInterfaces(name):
+        """returns the interface or interface tuple that
+        object instances created by the named factory will implement."""
+    
 
-class IViewFactory(Interface):
+class IUtilityService(Interface):
 
-    def __call__(object, request):
-        """Create a view for the object and request
+    def getUtility(interface, name=''):
+        """Look up a utility that provides an interface.
 
-        The request must be an IPresentationRequest.
+        If one is not found, raises
+        Zope.ComponentArchitecture.ComponentLookupError.
 
         """
 
+    def queryUtility(interface, default=None, name=''):
+        """Look up a utility that provides an interface.
 
-"""
+        If one is not found, returns default.
 
-$Id$
-"""
+        """
 
-from zope.interface import Interface
-from zope.interface.element import Attribute
 
 class IContextDependent(Interface):
 
@@ -340,14 +255,6 @@
         
         """)
 
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-
 class IAdapterService(Interface):
 
     def getAdapter(object, interface, name=''):
@@ -390,13 +297,53 @@
 
         """
 
+class IPresentation(Interface):
+    """Presentation components provide interfaces to external actors
 
-"""
+    The are created for requests, which encapsulate external actors,
+    connections, etc.
 
-$Id$
-"""
+    """
 
-from zope.interface import Interface
+    request = Attribute(
+        """The request
+
+        The request is a surrogate for the user. It also provides the
+        presentation type and skin. It is of type
+        IPresentationRequest.
+
+        """)
+
+class IPresentationRequest(Interface):
+    """An IPresentationRequest provides methods for getting view meta data.
+    """
+
+    def getPresentationType():
+        """Get a view type
+
+        The view type is expressed as an interface, as would be passed
+        to IViewService.getView.
+        """
+
+    def getPresentationSkin():
+        """Get the skin to be used for a request.
+
+        The skin is a string as would be passed
+        to IViewService.getView.
+        """
+
+class IResource(IPresentation):
+    """Resources provide data to be used for presentation.
+    """
+
+class IResourceFactory(Interface):
+
+    def __call__(request):
+        """Create a resource for a request
+
+        The request must be an IPresentationRequest.
+
+        """
 
 class IResourceService(Interface):
 
@@ -427,56 +374,23 @@
 
 
 
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-from zope.interface.element import Attribute
-
-class IPresentation(Interface):
-    """Presentation components provide interfaces to external actors
-
-    The are created for requests, which encapsulate external actors,
-    connections, etc.
-
+class IView(IPresentation, IContextDependent):
+    """Views provide a connection between an external actor and an object
     """
 
-    request = Attribute(
-        """The request
-
-        The request is a surrogate for the user. It also provides the
-        presentation type and skin. It is of type
-        IPresentationRequest.
-
-        """)
-
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-
-class IResourceFactory(Interface):
-
-    def __call__(request):
-        """Create a resource for a request
+class IViewFactory(Interface):
+    """Objects for creating views
+    """
 
-        The request must be an IPresentationRequest.
+    def __call__(context, request):
+        """Create an view (IView) object
 
+        The context aregument is the object displayed by the view. The
+        request argument is an object, such as a web request, that
+        "stands in" for the user.
         """
 
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
+    
 
 class IViewService(Interface):
 
@@ -520,56 +434,12 @@
         default view name for the object cannot be found.
         """
 
+class ISkinService(Interface):
 
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-
-class IPresentationRequest(Interface):
-    """An IPresentationRequest provides methods for getting view meta data.
-    """
-
-    def getPresentationType():
-        """Get a view type
-
-        The view type is expressed as an interface, as would be passed
-        to IViewService.getView.
-        """
-
-    def getPresentationSkin():
-        """Get the skin to be used for a request.
-
-        The skin is a string as would be passed
-        to IViewService.getView.
-        """
-
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-
-
-
-class IView(IPresentation, IContextDependent):
-    """Views provide a connection between an external actor and an object
-    """
-
-class IViewFactory(Interface):
-    """Objects for creating views
-    """
+    def getSkin(object, name, view_type):
+        """Return the sequence of layers (names) making up the skin.
 
-    def __call__(context, request):
-        """Create an view (IView) object
+        The object provides a place to look for placeful skin definitions.
 
-        The context aregument is the object displayed by the view. The
-        request argument is an object, such as a web request, that
-        "stands in" for the user.
+        If the skin was not defined, an empty sequence will be returned.
         """
-
-