[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/process/ Move all
interfaces for zope.app.process into a single module.
Fred L. Drake, Jr.
fred at zope.com
Thu May 13 14:58:46 EDT 2004
Log message for revision 24632:
Move all interfaces for zope.app.process into a single module.
-=-
Copied: Zope3/trunk/src/zope/app/process/interfaces.py (from rev 24625, Zope3/trunk/src/zope/app/process/interfaces/simpleregistry.py)
===================================================================
--- Zope3/trunk/src/zope/app/process/interfaces/simpleregistry.py 2004-05-13 15:25:53 UTC (rev 24625)
+++ Zope3/trunk/src/zope/app/process/interfaces.py 2004-05-13 18:58:45 UTC (rev 24632)
@@ -0,0 +1,72 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 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 for the zope.app.process package.
+
+$Id$
+"""
+
+from zope.interface import Interface
+
+
+class IPublicationRequestFactoryFactory(Interface):
+ """Publication request factory factory"""
+
+ def realize(db):
+ """Create a publication and request factory for a given database
+
+ Return a IPublicationRequestFactory for the given database.
+ """
+
+
+class IPublicationRequestFactory(Interface):
+ """Publication request factory"""
+
+ def __call__(input_stream, output_steam, env):
+ """Create a request object to handle the given inputs
+
+ A request is created and configured with a publication object.
+ """
+
+
+class IRequestFactory(IPublicationRequestFactory,
+ IPublicationRequestFactoryFactory):
+ """This is a pure read-only interface, since the values are set through
+ a ZCML directive and we shouldn't be able to change them.
+ """
+
+
+class ISimpleRegistry(Interface):
+ """
+ The Simple Registry is minimal collection of registered objects. This can
+ be useful, when it is expected that objects of a particular type are added
+ from many places in the system (through 3rd party products for example).
+
+ A good example for this are the Formulator fields. While the basic types
+ are defined inside the Formulator tree, other parties might add many
+ more later on in their products, so it is useful to provide a registry via
+ ZCML that allows to collect these items.
+
+ There is only one constraint on the objects. They all must implement a
+ particular interface specified during the initialization of the registry.
+
+ Note that it does not matter whether we have classes or instances as
+ objects. If the objects are instances, they must implement simply
+ IInstanceFactory.
+ """
+
+ def register(name, object):
+ """Registers the object under the id name."""
+
+ def getF(name):
+ """This returns the object with id name."""
Property changes on: Zope3/trunk/src/zope/app/process/interfaces.py
___________________________________________________________________
Name: cvs2svn:cvs-rev
+ 1.1
Name: svn:mime-type
+ text/x-python
Name: svn:eol-style
+ native
Modified: Zope3/trunk/src/zope/app/process/requestfactoryregistry.py
===================================================================
--- Zope3/trunk/src/zope/app/process/requestfactoryregistry.py 2004-05-13 18:33:46 UTC (rev 24631)
+++ Zope3/trunk/src/zope/app/process/requestfactoryregistry.py 2004-05-13 18:58:45 UTC (rev 24632)
@@ -12,11 +12,11 @@
#
##############################################################################
"""
-$Id: requestfactoryregistry.py,v 1.3 2004/03/13 20:24:21 srichter Exp $
+$Id$
"""
from zope.interface import implements
-from interfaces.simpleregistry import ISimpleRegistry
-from interfaces import IPublicationRequestFactoryFactory
+from zope.app.process.interfaces import ISimpleRegistry
+from zope.app.process.interfaces import IPublicationRequestFactoryFactory
from zope.app.process.simpleregistry import SimpleRegistry
Modified: Zope3/trunk/src/zope/app/process/servertyperegistry.py
===================================================================
--- Zope3/trunk/src/zope/app/process/servertyperegistry.py 2004-05-13 18:33:46 UTC (rev 24631)
+++ Zope3/trunk/src/zope/app/process/servertyperegistry.py 2004-05-13 18:58:45 UTC (rev 24632)
@@ -12,9 +12,9 @@
#
##############################################################################
"""
-$Id: servertyperegistry.py,v 1.4 2004/03/13 20:24:21 srichter Exp $
+$Id$
"""
-from interfaces.simpleregistry import ISimpleRegistry
+from zope.app.process.interfaces import ISimpleRegistry
from zope.app.process.servertype import IServerType
from zope.app.process.simpleregistry import SimpleRegistry
from zope.interface import implements
Modified: Zope3/trunk/src/zope/app/process/simpleregistry.py
===================================================================
--- Zope3/trunk/src/zope/app/process/simpleregistry.py 2004-05-13 18:33:46 UTC (rev 24631)
+++ Zope3/trunk/src/zope/app/process/simpleregistry.py 2004-05-13 18:58:45 UTC (rev 24632)
@@ -12,14 +12,14 @@
#
##############################################################################
"""
-$Id: simpleregistry.py,v 1.5 2004/03/13 20:24:21 srichter Exp $
+$Id$
"""
-from interfaces.simpleregistry import ISimpleRegistry
-from types import ListType, TupleType
+from zope.app.process.interfaces import ISimpleRegistry
from zope.interface import implements
-ListTypes = (TupleType, ListType)
+ListTypes = (tuple, list)
+
class ZopeDuplicateRegistryEntryError(Exception):
"""
This Error is raised when the user tries to add an object with
More information about the Zope3-Checkins
mailing list