[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/startup - __init__.py:1.2 simpleregistry.py:1.2

Jim Fulton jim@zope.com
Wed, 25 Dec 2002 09:14:04 -0500


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

Added Files:
	__init__.py simpleregistry.py 
Log Message:
Grand renaming:

- Renamed most files (especially python modules) to lower case.

- Moved views and interfaces into separate hierarchies within each
  project, where each top-level directory under the zope package
  is a separate project.

- Moved everything to src from lib/python.

  lib/python will eventually go away. I need access to the cvs
  repository to make this happen, however.

There are probably some bits that are broken. All tests pass
and zope runs, but I haven't tried everything. There are a number
of cleanups I'll work on tomorrow.



=== Zope3/src/zope/app/interfaces/startup/__init__.py 1.1 => 1.2 ===
--- /dev/null	Wed Dec 25 09:14:04 2002
+++ Zope3/src/zope/app/interfaces/startup/__init__.py	Wed Dec 25 09:13:03 2002
@@ -0,0 +1,2 @@
+#
+# This file is necessary to make this directory a package.


=== Zope3/src/zope/app/interfaces/startup/simpleregistry.py 1.1 => 1.2 ===
--- /dev/null	Wed Dec 25 09:14:04 2002
+++ Zope3/src/zope/app/interfaces/startup/simpleregistry.py	Wed Dec 25 09:13:03 2002
@@ -0,0 +1,50 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
+from zope.interface import Interface
+
+
+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.
+        """