[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/ Move object event stuff to zope.lifecycleevent

Philipp von Weitershausen philikon at philikon.de
Thu Apr 6 18:35:33 EDT 2006


Log message for revision 66625:
  Move object event stuff to zope.lifecycleevent
  

Changed:
  D   Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py
  D   Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py
  U   Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py
  A   Zope3/branches/jim-adapter/src/zope/lifecycleevent/DEPENDENCIES.cfg
  A   Zope3/branches/jim-adapter/src/zope/lifecycleevent/README.txt
  A   Zope3/branches/jim-adapter/src/zope/lifecycleevent/__init__.py
  A   Zope3/branches/jim-adapter/src/zope/lifecycleevent/interfaces.py
  A   Zope3/branches/jim-adapter/src/zope/lifecycleevent/tests.py

-=-
Deleted: Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py	2006-04-06 22:34:43 UTC (rev 66624)
+++ Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py	2006-04-06 22:35:31 UTC (rev 66625)
@@ -1,77 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002, 2003 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.
-#
-##############################################################################
-"""Event-related interfaces
-
-$Id$
-"""
-__docformat__ = 'restructuredtext'
-
-from zope.interface import Interface, Attribute
-import zope.deferredimport
-import zope.component.interfaces
-
-zope.deferredimport.deprecated(
-    "IObjectEvent is now defined in zope.component.interfaces.  "
-    "Importing IObjectEvent from zope.app.event will be disabled in Zope 3.5.",
-    IObjectEvent = 'zope.component.interfaces:IObjectEvent',
-    )
-
-class IObjectCreatedEvent(zope.component.interfaces.IObjectEvent):
-    """An object has been created.
-
-    The location will usually be ``None`` for this event."""
-
-
-class IObjectCopiedEvent(IObjectCreatedEvent):
-    """An object has been copied"""
-
-    original = Attribute("The original from which the copy was made")
-
-
-class IObjectModifiedEvent(zope.component.interfaces.IObjectEvent):
-    """An object has been modified"""
-
-
-class IModificationDescription(Interface) :
-    """ Marker interface for descriptions of object modifications.
-
-    Can be used as a parameter of an IObjectModifiedEvent."""
-
-
-class IAttributes(IModificationDescription) :
-    """ Describes the attributes of an interface.
-
-    """
-
-    interface = Attribute("The involved interface.")
-    attributes = Attribute("A sequence of modified attributes.")
-
-
-class ISequence(IModificationDescription) :
-    """ Describes the modified keys of a sequence-like interface.
-
-    """
-
-    interface = Attribute("The involved interface.")
-    keys = Attribute("A sequence of modified keys.")
-
-
-# BBB: will go in Zope3.3
-
-class IObjectAnnotationsModifiedEvent(IObjectModifiedEvent):
-    """An object's annotations have been modified"""
-
-
-class IObjectContentModifiedEvent(IObjectModifiedEvent):
-    """An object's content has been modified"""

Deleted: Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py	2006-04-06 22:34:43 UTC (rev 66624)
+++ Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py	2006-04-06 22:35:31 UTC (rev 66625)
@@ -1,178 +0,0 @@
-##############################################################################
-#
-# 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.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.
-#
-##############################################################################
-"""In Zope3 events are used by components to inform each other
-about relevant new objects and object modifications.
-
-To keep all subscribers up to date it is indispensable that the life cycle of 
-an object is accompanied by various events. 
-
-    >>> class Sample(object) :
-    ...    "Test class"
-
-    >>> obj = Sample()
-    >>> notify(ObjectCreatedEvent(obj))
-    
-    >>> obj.modified = True
-    >>> notify(ObjectModifiedEvent(obj))
-    
-Zope3's Dublin Core Metadata for instance, rely on the bare
-ObjectCreatedEvent and ObjectModifiedEvent to record creation and modification
-times. Other event consumers like catalogs and caches may need more information 
-to update themselves in an efficient manner. The necessary information can
-be provided as optional modification descriptions of the ObjectModifiedEvent.
-
-Some examples:
-    
-    >>> from zope.app.file import File
-    >>> from zope.app.file.interfaces import IFile
-    >>> file = File()
-    >>> file.data = "123"
-    >>> notify(ObjectModifiedEvent(obj, IFile))
-    
-This says that we modified something via IFile.  Note that an interface is an 
-acceptable description. In fact, we might allow pretty much anything as a 
-description and it depends on your needs what kind of descriptions 
-you use.
-
-In the following we use an IAttributes description to describe in more detail
-which parts of an object where modified :
-
-    >>> file.data = "456"
- 
-    >>> from zope.app.dublincore.interfaces import IZopeDublinCore
-    >>> from zope.interface import directlyProvides
-    >>> from zope.annotation.interfaces import IAttributeAnnotatable
-    >>> directlyProvides(file, IAttributeAnnotatable) 
-    
-    >>> IZopeDublinCore(file).title = u"New title"
-    >>> IZopeDublinCore(file).title = u"New description"
-    >>> event = ObjectModifiedEvent(obj, Attributes(IFile, 'data'),
-    ...                  Attributes(IZopeDublinCore, 'title', 'description'),
-    ...                  )
-    >>> notify(event)
-
-This says we modified the file data and the DC title and description.
-
-
-$Id$
-"""
-__docformat__ = 'restructuredtext'
-
-from zope.app.event.interfaces import IObjectCreatedEvent
-from zope.app.event.interfaces import IObjectModifiedEvent
-from zope.app.event.interfaces import IObjectCopiedEvent
-from zope.app.event.interfaces import IObjectAnnotationsModifiedEvent
-from zope.app.event.interfaces import IObjectContentModifiedEvent
-from zope.app.event.interfaces import IAttributes, ISequence
-from zope.interface import implements
-from zope.event import notify
-import zope.component.interfaces
-from zope.component import subscribers
-import zope.deferredimport
-
-_marker = object()
-
-zope.deferredimport.deprecated(
-    "ObjectEvent is now defined in zope.component.interfaces.  "
-    "Importing ObjectEvent from zope.app.event will be disabled in Zope 3.5.",
-    ObjectEvent = 'zope.component.interfaces:ObjectEvent',
-    )
-
-zope.deferredimport.deprecated(
-    "It has moved to zope.component.event.  This reference will be gone "
-    "in Zope 3.5",
-    objectEventNotify = 'zope.component.event:objectEventNotify',
-    )
-
-class ObjectCreatedEvent(zope.component.interfaces.ObjectEvent):
-    """An object has been created"""
-
-    implements(IObjectCreatedEvent)
-
-
-class Attributes(object) :
-    """
-    Describes modified attributes of an interface.
-
-        >>> from zope.app.dublincore.interfaces import IZopeDublinCore
-        >>> desc = Attributes(IZopeDublinCore, "title", "description")
-        >>> desc.interface == IZopeDublinCore
-        True
-        >>> 'title' in desc.attributes
-        True
-
-    """
-
-    implements(IAttributes)
-
-    def __init__(self, interface, *attributes) :
-        self.interface = interface
-        self.attributes = attributes
-
-
-class Sequence(object) :
-    """
-    Describes modified keys of an interface.
-    
-        >>> from zope.app.container.interfaces import IContainer
-        >>> desc = Sequence(IContainer, 'foo', 'bar')
-        >>> desc.interface == IContainer
-        True
-        >>> desc.keys
-        ('foo', 'bar')
-
-    """
-    
-    implements(ISequence)
-    
-    def __init__(self, interface, *keys) :
-        self.interface = interface
-        self.keys = keys
-
-class ObjectModifiedEvent(zope.component.interfaces.ObjectEvent):
-    """An object has been modified"""
-
-    implements(IObjectModifiedEvent)
-
-    def __init__(self, object, *descriptions) :
-        """
-        Init with a list of modification descriptions.
-        
-        >>> from zope.interface import implements, Interface, Attribute
-        >>> class ISample(Interface) :
-        ...     field = Attribute("A test field")
-        >>> class Sample(object) :
-        ...     implements(ISample)
-        
-        >>> obj = Sample()
-        >>> obj.field = 42
-        >>> notify(ObjectModifiedEvent(obj, Attributes(ISample, "field")))
-        
-        """
-        super(ObjectModifiedEvent, self).__init__(object) 
-        self.descriptions = descriptions
-        
-
-def modified(object, *descriptions):
-    notify(ObjectModifiedEvent(object, *descriptions))
-
-
-class ObjectCopiedEvent(ObjectCreatedEvent):
-    """An object has been copied"""
-
-    implements(IObjectCopiedEvent)
-
-    def __init__(self, object, original):
-        super(ObjectCopiedEvent, self).__init__(object)
-        self.original = original

Modified: Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py	2006-04-06 22:34:43 UTC (rev 66624)
+++ Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py	2006-04-06 22:35:31 UTC (rev 66625)
@@ -25,25 +25,12 @@
 
 from zope.app.dublincore.interfaces import IZopeDublinCore
 from zope.app.dublincore.annotatableadapter import ZDCAnnotatableAdapter
-from zope.app.event.objectevent import ObjectModifiedEvent
 from zope.app.container.contained import Contained, ObjectRemovedEvent
 from zope.app.container.interfaces import IContained, IObjectRemovedEvent
 from zope.app.container.sample import SampleContainer
 from zope.app.testing.placelesssetup import setUp, tearDown
 from zope.app.testing import ztapi
 
-    
-class TestObjectModifiedEvent(unittest.TestCase):
-
-    klass = ObjectModifiedEvent
-    object = object()
-
-    def setUp(self):
-        self.event = self.klass(self.object)
-
-    def testGetObject(self):
-        self.assertEqual(self.event.object, self.object)
-
 class TestObjectEventNotifications(unittest.TestCase):
     def setUp(self):
         self.callbackTriggered = False
@@ -108,7 +95,6 @@
 
 def test_suite():
     return unittest.TestSuite((
-        unittest.makeSuite(TestObjectModifiedEvent),
         unittest.makeSuite(TestObjectEventNotifications),
         doctest.DocTestSuite("zope.app.event.objectevent",
                              setUp=setUpObjectEventDocTest,

Added: Zope3/branches/jim-adapter/src/zope/lifecycleevent/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/lifecycleevent/DEPENDENCIES.cfg	2006-04-06 22:34:43 UTC (rev 66624)
+++ Zope3/branches/jim-adapter/src/zope/lifecycleevent/DEPENDENCIES.cfg	2006-04-06 22:35:31 UTC (rev 66625)
@@ -0,0 +1,5 @@
+zope.app # dublincore for testing
+zope.component
+zope.deferredimport
+zope.event
+zope.interface

Added: Zope3/branches/jim-adapter/src/zope/lifecycleevent/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/lifecycleevent/README.txt	2006-04-06 22:34:43 UTC (rev 66624)
+++ Zope3/branches/jim-adapter/src/zope/lifecycleevent/README.txt	2006-04-06 22:35:31 UTC (rev 66625)
@@ -0,0 +1,70 @@
+Life-cycle events
+=================
+
+In Zope 3, events are used by components to inform each other about
+relevant new objects and object modifications.
+
+To keep all subscribers up to date it is indispensable that the life
+cycle of an object is accompanied by various events.
+
+    >>> from zope.event import notify
+    >>> from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
+
+    >>> class Sample(object) :
+    ...    "Test class"
+
+    >>> obj = Sample()
+    >>> notify(ObjectCreatedEvent(obj))
+    
+    >>> obj.modified = True
+    >>> notify(ObjectModifiedEvent(obj))
+    
+Zope 3's Dublin Core Metadata for instance, rely on the bare
+ObjectCreatedEvent and ObjectModifiedEvent to record creation and
+modification times. Other event consumers like catalogs and caches may
+need more information to update themselves in an efficient manner. The
+necessary information can be provided as optional modification
+descriptions of the ObjectModifiedEvent.
+
+Some examples:
+
+    >>> from zope.interface import Interface, Attribute, implements
+    >>> class IFile(Interface):
+    ...     data = Attribute("Data")
+    ... 
+
+    >>> class File(object):
+    ...     implements(IFile)
+    ...
+
+    >>> file = File()
+    >>> file.data = "123"
+    >>> notify(ObjectModifiedEvent(obj, IFile))
+    
+This says that we modified something via IFile.  Note that an interface is an 
+acceptable description. In fact, we might allow pretty much anything as a 
+description and it depends on your needs what kind of descriptions 
+you use.
+
+In the following we use an IAttributes description to describe in more detail
+which parts of an object where modified :
+
+    >>> file.data = "456"
+ 
+    >>> from zope.app.dublincore.interfaces import IZopeDublinCore
+    >>> from zope.interface import directlyProvides
+    >>> from zope.annotation.interfaces import IAttributeAnnotatable
+    >>> directlyProvides(file, IAttributeAnnotatable) 
+    
+    >>> IZopeDublinCore(file).title = u"New title"
+    >>> IZopeDublinCore(file).title = u"New description"
+
+    >>> from zope.lifecycleevent import Attributes
+    >>> event = ObjectModifiedEvent(
+    ...     obj,
+    ...     Attributes(IFile, 'data'),
+    ...     Attributes(IZopeDublinCore, 'title', 'description'),
+    ...     )
+    >>> notify(event)
+
+This says we modified the file data and the DC title and description.


Property changes on: Zope3/branches/jim-adapter/src/zope/lifecycleevent/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: Zope3/branches/jim-adapter/src/zope/lifecycleevent/__init__.py (from rev 66612, Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py)
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py	2006-04-06 19:52:36 UTC (rev 66612)
+++ Zope3/branches/jim-adapter/src/zope/lifecycleevent/__init__.py	2006-04-06 22:35:31 UTC (rev 66625)
@@ -0,0 +1,129 @@
+##############################################################################
+#
+# 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.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.
+#
+##############################################################################
+"""Life cycle events
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+import zope.component.interfaces
+from zope.component import subscribers
+from zope.interface import implements
+from zope.event import notify
+from zope.lifecycleevent.interfaces import IObjectCreatedEvent
+from zope.lifecycleevent.interfaces import IObjectModifiedEvent
+from zope.lifecycleevent.interfaces import IObjectCopiedEvent
+from zope.lifecycleevent.interfaces import IAttributes, ISequence
+
+_marker = object()
+
+##############################################################################
+# BBB 2006/04/03 -- to be removed after 12 months
+
+import zope.deferredimport
+zope.deferredimport.deprecated(
+    "It has moved to zope.component.interfaces.  This reference will be "
+    "gone in Zope 3.5.",
+    ObjectEvent = 'zope.component.interfaces:ObjectEvent',
+    )
+zope.deferredimport.deprecated(
+    "It has moved to zope.component.event.  This reference will be gone "
+    "in Zope 3.5",
+    objectEventNotify = 'zope.component.event:objectEventNotify',
+    )
+
+#
+##############################################################################
+
+class ObjectCreatedEvent(zope.component.interfaces.ObjectEvent):
+    """An object has been created"""
+
+    implements(IObjectCreatedEvent)
+
+
+class Attributes(object) :
+    """
+    Describes modified attributes of an interface.
+
+        >>> from zope.app.dublincore.interfaces import IZopeDublinCore
+        >>> desc = Attributes(IZopeDublinCore, "title", "description")
+        >>> desc.interface == IZopeDublinCore
+        True
+        >>> 'title' in desc.attributes
+        True
+
+    """
+
+    implements(IAttributes)
+
+    def __init__(self, interface, *attributes) :
+        self.interface = interface
+        self.attributes = attributes
+
+
+class Sequence(object) :
+    """
+    Describes modified keys of an interface.
+    
+        >>> from zope.app.container.interfaces import IContainer
+        >>> desc = Sequence(IContainer, 'foo', 'bar')
+        >>> desc.interface == IContainer
+        True
+        >>> desc.keys
+        ('foo', 'bar')
+
+    """
+    
+    implements(ISequence)
+    
+    def __init__(self, interface, *keys) :
+        self.interface = interface
+        self.keys = keys
+
+class ObjectModifiedEvent(zope.component.interfaces.ObjectEvent):
+    """An object has been modified"""
+
+    implements(IObjectModifiedEvent)
+
+    def __init__(self, object, *descriptions) :
+        """
+        Init with a list of modification descriptions.
+        
+        >>> from zope.interface import implements, Interface, Attribute
+        >>> class ISample(Interface) :
+        ...     field = Attribute("A test field")
+        >>> class Sample(object) :
+        ...     implements(ISample)
+        
+        >>> obj = Sample()
+        >>> obj.field = 42
+        >>> notify(ObjectModifiedEvent(obj, Attributes(ISample, "field")))
+        
+        """
+        super(ObjectModifiedEvent, self).__init__(object) 
+        self.descriptions = descriptions
+        
+
+def modified(object, *descriptions):
+    notify(ObjectModifiedEvent(object, *descriptions))
+
+
+class ObjectCopiedEvent(ObjectCreatedEvent):
+    """An object has been copied"""
+
+    implements(IObjectCopiedEvent)
+
+    def __init__(self, object, original):
+        super(ObjectCopiedEvent, self).__init__(object)
+        self.original = original

Copied: Zope3/branches/jim-adapter/src/zope/lifecycleevent/interfaces.py (from rev 66532, Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py)
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py	2006-04-05 13:52:36 UTC (rev 66532)
+++ Zope3/branches/jim-adapter/src/zope/lifecycleevent/interfaces.py	2006-04-06 22:35:31 UTC (rev 66625)
@@ -0,0 +1,67 @@
+##############################################################################
+#
+# Copyright (c) 2002, 2003 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.
+#
+##############################################################################
+"""Event-related interfaces
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+from zope.interface import Interface, Attribute
+import zope.deferredimport
+import zope.component.interfaces
+
+zope.deferredimport.deprecated(
+    "It has moved to zope.component.interfaces.  This reference will be "
+    "gone in Zope 3.5.",
+    IObjectEvent = 'zope.component.interfaces:IObjectEvent',
+    )
+
+class IObjectCreatedEvent(zope.component.interfaces.IObjectEvent):
+    """An object has been created.
+
+    The location will usually be ``None`` for this event."""
+
+
+class IObjectCopiedEvent(IObjectCreatedEvent):
+    """An object has been copied"""
+
+    original = Attribute("The original from which the copy was made")
+
+
+class IObjectModifiedEvent(zope.component.interfaces.IObjectEvent):
+    """An object has been modified"""
+
+
+class IModificationDescription(Interface) :
+    """ Marker interface for descriptions of object modifications.
+
+    Can be used as a parameter of an IObjectModifiedEvent."""
+
+
+class IAttributes(IModificationDescription) :
+    """ Describes the attributes of an interface.
+
+    """
+
+    interface = Attribute("The involved interface.")
+    attributes = Attribute("A sequence of modified attributes.")
+
+
+class ISequence(IModificationDescription) :
+    """ Describes the modified keys of a sequence-like interface.
+
+    """
+
+    interface = Attribute("The involved interface.")
+    keys = Attribute("A sequence of modified keys.")

Copied: Zope3/branches/jim-adapter/src/zope/lifecycleevent/tests.py (from rev 66611, Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py)
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py	2006-04-06 19:49:20 UTC (rev 66611)
+++ Zope3/branches/jim-adapter/src/zope/lifecycleevent/tests.py	2006-04-06 22:35:31 UTC (rev 66625)
@@ -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.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.
+#
+##############################################################################
+"""Object Event Tests
+
+$Id$
+"""
+import unittest
+import zope.component.testing
+from zope.testing import doctest
+from zope.lifecycleevent import ObjectModifiedEvent
+
+class TestObjectModifiedEvent(unittest.TestCase):
+
+    klass = ObjectModifiedEvent
+    object = object()
+
+    def setUp(self):
+        self.event = self.klass(self.object)
+
+    def testGetObject(self):
+        self.assertEqual(self.event.object, self.object)
+
+def setUpDoctest(test):
+    from zope.annotation.attribute import AttributeAnnotations
+    from zope.app.dublincore.interfaces import IWriteZopeDublinCore
+    from zope.app.dublincore.annotatableadapter import ZDCAnnotatableAdapter
+    zope.component.provideAdapter(AttributeAnnotations)
+    zope.component.provideAdapter(ZDCAnnotatableAdapter,
+                                  provides=IWriteZopeDublinCore)
+
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(TestObjectModifiedEvent),
+        doctest.DocFileSuite('README.txt', setUp=setUpDoctest,
+                             tearDown=zope.component.testing.tearDown),
+        ))
+
+if __name__=='__main__':
+    unittest.main(defaultTest='test_suite')



More information about the Zope3-Checkins mailing list