[Checkins] SVN: zope.processlifetime/trunk/ Port event interfaces / implementations from zope.app.appsetup.

Tres Seaver tseaver at palladion.com
Wed May 13 15:02:48 EDT 2009


Log message for revision 99904:
  Port event interfaces / implementations from zope.app.appsetup.

Changed:
  U   zope.processlifetime/trunk/CHANGES.txt
  U   zope.processlifetime/trunk/README.txt
  U   zope.processlifetime/trunk/buildout.cfg
  U   zope.processlifetime/trunk/setup.py
  _U  zope.processlifetime/trunk/src/
  D   zope.processlifetime/trunk/src/zope/app/
  A   zope.processlifetime/trunk/src/zope/processlifetime/
  A   zope.processlifetime/trunk/src/zope/processlifetime/__init__.py
  A   zope.processlifetime/trunk/src/zope/processlifetime/tests.py

-=-
Modified: zope.processlifetime/trunk/CHANGES.txt
===================================================================
--- zope.processlifetime/trunk/CHANGES.txt	2009-05-13 18:39:03 UTC (rev 99903)
+++ zope.processlifetime/trunk/CHANGES.txt	2009-05-13 19:02:48 UTC (rev 99904)
@@ -1,89 +1,8 @@
-CHANGES
-=======
+zope.processlifetime Changelog
+==============================
 
-3.10.2 (unreleased)
--------------------
+1.0 (unreleased)
+----------------
 
-- Nothing changed yet.
-
-
-3.10.1 (2009-03-31)
--------------------
-
-- Fixed a ``DeprecationWarning`` introduced in 3.10.0.
-
-- Added doctests to long description to show up at pypi.
-
-
-3.10.0 (2009-03-19)
--------------------
-
-- Finally deprecate the "asObject" argument of helper functions in the
-  ``zope.app.appsetup.bootstrap`` module. If your code uses any of these
-  functions, please remove the "asObject=True" argument passing anywhere,
-  because the support for that argument will be dropped soon.
-
-- Move session utility bootstrapping logic from ``zope.session`` into this
-  package. This removes a dependency from zope.session to this package.
-
-- Remove one more deprecated function.
-
-
-3.9.0 (2009-01-31)
-------------------
-
-- Use ``zope.site`` instead of ``zope.app.folder`` and
-  ``zope.app.component``.
-
-- Use ``zope.container`` instead of ``zope.app.container``.
-
-- Move error log bootstrapping logic from ``zope.error`` into this
-  package.  This removes a dependency from zope.error to this
-  package. Also added a test for bootstrapping the error log here,
-  which was missing in ``zope.error``.
-
-
-3.8.0 (2008-08-25)
-------------------
-
-- Feature: Developed an entry point that allows you to quickly bring up an
-  application instance for debugging purposes. (Implemented by Marius Gedminas
-  and Stephan Richter.)
-
-
-3.7.0 (2008-08-19)
-------------------
-
-- Added ``.product.loadConfiguration`` test-support function; loads product
-  configuration (only) from a file object, allowing test code (including
-  setup) to make use of the same configuration schema support used by normal
-  startup.
-
-
-3.6.0 (2008-07-23)
-------------------
-
-- Added additional test support functions to set the configuration for a
-  single section, and save/restore the entire configuration.
-
-
-3.5.0 (2008-06-17)
-------------------
-
-- Added helper class for supporting product configuration tests.
-
-- Added documentation for the product configuration API, with tests.
-
-
-3.4.1 (2007-09-27)
-------------------
-
-- Egg was faulty, re-released.
-
-
-3.4.0 (2007-09-25)
-------------------
-
-- Initial documented release.
-
-- Reflect changes form zope.app.error refactoring.
+- Split out event interfaces / implementations from ``zope.app.appsetup``
+  version 3.10.2.

Modified: zope.processlifetime/trunk/README.txt
===================================================================
--- zope.processlifetime/trunk/README.txt	2009-05-13 18:39:03 UTC (rev 99903)
+++ zope.processlifetime/trunk/README.txt	2009-05-13 19:02:48 UTC (rev 99904)
@@ -1 +1,7 @@
-This package provides application setup helpers.
+zope.processlifetime README
+===========================
+
+This package provides interfaces / implementations for events relative to
+the lifetime of a server process (startup, database opening, etc.)
+
+It is derived from Zope 3.4's 'zope.app.appsetup'.

Modified: zope.processlifetime/trunk/buildout.cfg
===================================================================
--- zope.processlifetime/trunk/buildout.cfg	2009-05-13 18:39:03 UTC (rev 99903)
+++ zope.processlifetime/trunk/buildout.cfg	2009-05-13 19:02:48 UTC (rev 99904)
@@ -4,13 +4,13 @@
 
 [test]
 recipe = zc.recipe.testrunner
-eggs = zope.app.appsetup [test]
+eggs = zope.processlifetime
 
 [python]
 recipe = zc.recipe.egg
-eggs = zope.app.appsetup
+eggs = zope.processlifetime
 interpreter = python
 
 [tags]
 recipe = z3c.recipe.tag:tags
-eggs = zope.app.appsetup
+eggs = zope.processlifetime

Modified: zope.processlifetime/trunk/setup.py
===================================================================
--- zope.processlifetime/trunk/setup.py	2009-05-13 18:39:03 UTC (rev 99903)
+++ zope.processlifetime/trunk/setup.py	2009-05-13 19:02:48 UTC (rev 99904)
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Setup for zope.app.appsetup package
+"""Setup for zope.processlifetime package
 
 $Id$
 """
@@ -24,26 +24,15 @@
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
 setup(
-    name='zope.app.appsetup',
-    version = '3.10.2 dev',
+    name='zope.processlifetime',
+    version = '1.0dev',
     author='Zope Corporation and Contributors',
     author_email='zope-dev at zope.org',
-    description="Zope app setup helper",
-    long_description=(
-        read('README.txt')
-        + '\n\n' +
-        '.. contents::'
-        + '\n\n' +
-        read('src', 'zope', 'app', 'appsetup', 'bootstrap.txt')
-        + '\n\n' +
-        read('src', 'zope', 'app', 'appsetup', 'debug.txt')
-        + '\n\n' +
-        read('src', 'zope', 'app', 'appsetup', 'product.txt')
-        + '\n\n' +
-        read('CHANGES.txt')
-        ),
+    description="Zope process lifetime events",
+    long_description=(read('README.txt') + '\n\n' +
+                      read('CHANGES.txt')),
     license='ZPL 2.1',
-    keywords="zope3 app setup",
+    keywords="zope process lifetime events",
     classifiers=[
         'Development Status :: 5 - Production/Stable',
         'Environment :: Web Environment',
@@ -53,32 +42,17 @@
         'Natural Language :: English',
         'Operating System :: OS Independent',
         'Topic :: Internet :: WWW/HTTP',
-        'Framework :: Zope3'],
-    url='http://pypi.python.org/pypi/zope.app.appsetup',
+        'Framework :: Zope3',
+        'Framework :: Zope2',
+        ],
+    url='http://pypi.python.org/pypi/zope.processlifetime',
     packages=find_packages('src'),
     package_dir={'': 'src'},
-    extras_require=dict(test=['zope.app.testing']),
-    namespace_packages=['zope', 'zope.app'],
+    test_suite='zope.processlifetime.tests',
+    namespace_packages=['zope'],
     install_requires=['setuptools',
-                      'zope.app.component',
-                      'zope.app.publication',
-                      'zope.component',
-                      'zope.configuration',
-                      'zope.container',
-                      'zope.error',
-                      'zope.event',
                       'zope.interface',
-                      'zope.location',
-                      'zope.session',
-                      'zope.site',
-                      'zope.security',
-                      'zope.traversing',
-                      'ZODB3',
-                      ],
+                     ],
     include_package_data=True,
     zip_safe=False,
-    entry_points = """
-        [console_scripts]
-        debug = zope.app.appsetup.debug:main
-        """,
     )


Property changes on: zope.processlifetime/trunk/src
___________________________________________________________________
Modified: svn:ignore
   - zope.app.appsetup.egg-info

   + *.egg-info


Copied: zope.processlifetime/trunk/src/zope/processlifetime/__init__.py (from rev 99903, zope.processlifetime/trunk/src/zope/app/appsetup/interfaces.py)
===================================================================
--- zope.processlifetime/trunk/src/zope/processlifetime/__init__.py	                        (rev 0)
+++ zope.processlifetime/trunk/src/zope/processlifetime/__init__.py	2009-05-13 19:02:48 UTC (rev 99904)
@@ -0,0 +1,47 @@
+##############################################################################
+#
+# Copyright (c) 2004-2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (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.
+#
+##############################################################################
+"""Events in the lifetime of a server process.
+"""
+from zope.interface import Attribute
+from zope.interface import Interface
+from zope.interface import implements
+
+class IDatabaseOpened(Interface):
+    """The main database has been opened.
+    """
+    database = Attribute("The main database.")
+
+class DatabaseOpened(object):
+    implements(IDatabaseOpened)
+
+    def __init__(self, database):
+        self.database = database
+
+class IDatabaseOpenedWithRoot(Interface):
+    """The main database has been opened.
+    """
+    database = Attribute("The main database.")
+
+class DatabaseOpenedWithRoot(object):
+    implements(IDatabaseOpenedWithRoot)
+
+    def __init__(self, database):
+        self.database = database
+
+class IProcessStarting(Interface):
+    """The application server process is starting.
+    """
+
+class ProcessStarting(object):
+    implements(IProcessStarting)

Added: zope.processlifetime/trunk/src/zope/processlifetime/tests.py
===================================================================
--- zope.processlifetime/trunk/src/zope/processlifetime/tests.py	                        (rev 0)
+++ zope.processlifetime/trunk/src/zope/processlifetime/tests.py	2009-05-13 19:02:48 UTC (rev 99904)
@@ -0,0 +1,53 @@
+import unittest
+
+class DatabaseOpenedTests(unittest.TestCase):
+    def _getTargetClass(self):
+        from zope.processlifetime import DatabaseOpened
+        return DatabaseOpened
+
+    def test_class_conforms_to_IDatabaseOpened(self):
+        from zope.interface.verify import verifyClass
+        from zope.processlifetime import IDatabaseOpened
+        verifyClass(IDatabaseOpened, self._getTargetClass())
+
+    def test_instance_conforms_to_IDatabaseOpened(self):
+        from zope.interface.verify import verifyObject
+        from zope.processlifetime import IDatabaseOpened
+        verifyObject(IDatabaseOpened, self._getTargetClass()(object()))
+
+class DatabaseOpenedWithRootTests(unittest.TestCase):
+    def _getTargetClass(self):
+        from zope.processlifetime import DatabaseOpenedWithRoot
+        return DatabaseOpenedWithRoot
+
+    def test_class_conforms_to_IDatabaseOpenedWithRoot(self):
+        from zope.interface.verify import verifyClass
+        from zope.processlifetime import IDatabaseOpenedWithRoot
+        verifyClass(IDatabaseOpenedWithRoot, self._getTargetClass())
+
+    def test_instance_conforms_to_IDatabaseOpenedWithRoot(self):
+        from zope.interface.verify import verifyObject
+        from zope.processlifetime import IDatabaseOpenedWithRoot
+        verifyObject(IDatabaseOpenedWithRoot, self._getTargetClass()(object()))
+
+class ProcessStartingTests(unittest.TestCase):
+    def _getTargetClass(self):
+        from zope.processlifetime import ProcessStarting
+        return ProcessStarting
+
+    def test_class_conforms_to_IProcessStarting(self):
+        from zope.interface.verify import verifyClass
+        from zope.processlifetime import IProcessStarting
+        verifyClass(IProcessStarting, self._getTargetClass())
+
+    def test_instance_conforms_to_IProcessStarting(self):
+        from zope.interface.verify import verifyObject
+        from zope.processlifetime import IProcessStarting
+        verifyObject(IProcessStarting, self._getTargetClass()())
+
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(DatabaseOpenedTests),
+        unittest.makeSuite(DatabaseOpenedWithRootTests),
+        unittest.makeSuite(ProcessStartingTests),
+    ))



More information about the Checkins mailing list