[Checkins] SVN: zope.lifecycleevent/tags/3.7.0/ tag zope.lifecycleevent 3.7.0
Fred Drake
fdrake at gmail.com
Thu Mar 17 10:44:28 EDT 2011
Log message for revision 121004:
tag zope.lifecycleevent 3.7.0
Changed:
A zope.lifecycleevent/tags/3.7.0/
D zope.lifecycleevent/tags/3.7.0/CHANGES.txt
A zope.lifecycleevent/tags/3.7.0/CHANGES.txt
D zope.lifecycleevent/tags/3.7.0/setup.py
A zope.lifecycleevent/tags/3.7.0/setup.py
D zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/__init__.py
A zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/__init__.py
D zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/interfaces.py
A zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/interfaces.py
-=-
Deleted: zope.lifecycleevent/tags/3.7.0/CHANGES.txt
===================================================================
--- zope.lifecycleevent/trunk/CHANGES.txt 2011-03-17 12:57:36 UTC (rev 121000)
+++ zope.lifecycleevent/tags/3.7.0/CHANGES.txt 2011-03-17 14:44:28 UTC (rev 121004)
@@ -1,57 +0,0 @@
-=======
-CHANGES
-=======
-
-3.6.3 (unreleased)
-------------------
-
-- Nothing changed yet.
-
-
-3.6.2 (2010-09-25)
-------------------
-
-- Added not declared, but needed test dependency on `zope.component [test]`.
-
-3.6.1 (2010-04-30)
-------------------
-
-- Removed dependency on undeclared zope.testing.doctest.
-
-3.6.0 (2009-12-29)
-------------------
-
-- Refactor tests to loose zope.annotation and zope.dublincore as dependencies.
-
-3.5.2 (2009-05-17)
-------------------
-
-- ``IObjectMovedEvent``, ``IObjectAddedEvent``,
- ``IObjectRemovedEvent`` interfaces and ``ObjectMovedEvent``,
- ``ObjectAddedEvent`` and ``ObjectRemovedEvent`` classes copied here
- from zope.container (plus tests). The intent is to allow packages
- that rely on these interfaces or the event classes to rely on
- zope.lifecycleevent (which has few dependencies) instead of
- zope.container (which has many).
-
-3.5.1 (2009-03-09)
-------------------
-
-- Remove deprecated code and thus remove dependency on zope.deferredimport.
-
-- Change package's mailing list address to zope-dev at zope.org, as
- zope3-dev at zope.org is now retired.
-
-- Update package's description and documentation.
-
-3.5.0 (2009-01-31)
-------------------
-
-- Remove old module declarations from classes.
-
-- Use zope.container instead of zope.app.container.
-
-3.4.0 (2007-09-01)
-------------------
-
-Initial release as an independent package
Copied: zope.lifecycleevent/tags/3.7.0/CHANGES.txt (from rev 121003, zope.lifecycleevent/trunk/CHANGES.txt)
===================================================================
--- zope.lifecycleevent/tags/3.7.0/CHANGES.txt (rev 0)
+++ zope.lifecycleevent/tags/3.7.0/CHANGES.txt 2011-03-17 14:44:28 UTC (rev 121004)
@@ -0,0 +1,58 @@
+=======
+CHANGES
+=======
+
+3.7.0 (2011-03-17)
+------------------
+
+- Added convenience functions to parallel zope.lifecycleevent.modified
+ for the other events defined in this package.
+
+
+3.6.2 (2010-09-25)
+------------------
+
+- Added not declared, but needed test dependency on `zope.component [test]`.
+
+3.6.1 (2010-04-30)
+------------------
+
+- Removed dependency on undeclared zope.testing.doctest.
+
+3.6.0 (2009-12-29)
+------------------
+
+- Refactor tests to loose zope.annotation and zope.dublincore as dependencies.
+
+3.5.2 (2009-05-17)
+------------------
+
+- ``IObjectMovedEvent``, ``IObjectAddedEvent``,
+ ``IObjectRemovedEvent`` interfaces and ``ObjectMovedEvent``,
+ ``ObjectAddedEvent`` and ``ObjectRemovedEvent`` classes copied here
+ from zope.container (plus tests). The intent is to allow packages
+ that rely on these interfaces or the event classes to rely on
+ zope.lifecycleevent (which has few dependencies) instead of
+ zope.container (which has many).
+
+3.5.1 (2009-03-09)
+------------------
+
+- Remove deprecated code and thus remove dependency on zope.deferredimport.
+
+- Change package's mailing list address to zope-dev at zope.org, as
+ zope3-dev at zope.org is now retired.
+
+- Update package's description and documentation.
+
+3.5.0 (2009-01-31)
+------------------
+
+- Remove old module declarations from classes.
+
+- Use zope.container instead of zope.app.container.
+
+3.4.0 (2007-09-01)
+------------------
+
+Initial release as an independent package
Deleted: zope.lifecycleevent/tags/3.7.0/setup.py
===================================================================
--- zope.lifecycleevent/trunk/setup.py 2011-03-17 12:57:36 UTC (rev 121000)
+++ zope.lifecycleevent/tags/3.7.0/setup.py 2011-03-17 14:44:28 UTC (rev 121004)
@@ -1,64 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Foundation 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.
-#
-##############################################################################
-# This package is developed by the Zope Toolkit project, documented here:
-# http://docs.zope.org/zopetoolkit
-# When developing and releasing this package, please follow the documented
-# Zope Toolkit policies as described by this documentation.
-##############################################################################
-"""Setup for zope.lifecycleevent package
-"""
-import os
-from setuptools import setup, find_packages
-
-def read(*rnames):
- return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-setup(
- name='zope.lifecycleevent',
- version='3.6.3dev',
- url='http://pypi.python.org/pypi/zope.lifecycleevent',
- author='Zope Foundation and Contributors',
- author_email='zope-dev at zope.org',
- license='ZPL 2.1',
- classifiers=[
- 'Development Status :: 5 - Production/Stable',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: Zope Public License',
- 'Programming Language :: Python',
- 'Operating System :: OS Independent',
- 'Topic :: Internet :: WWW/HTTP',
- 'Topic :: Software Development',
- ],
- description='Object life-cycle events',
- long_description=\
- read('src', 'zope', 'lifecycleevent', 'README.txt')
- + '\n\n' +
- read('CHANGES.txt'),
-
- packages=find_packages('src'),
- package_dir={'': 'src'},
- namespace_packages=['zope',],
- include_package_data=True,
- install_requires=['setuptools',
- 'zope.interface',
- 'zope.component',
- 'zope.event'],
- extras_require=dict(
- test = [
- 'zope.component [test]',
- 'zope.container',
- ]
- ),
- zip_safe=False,
- )
Copied: zope.lifecycleevent/tags/3.7.0/setup.py (from rev 121003, zope.lifecycleevent/trunk/setup.py)
===================================================================
--- zope.lifecycleevent/tags/3.7.0/setup.py (rev 0)
+++ zope.lifecycleevent/tags/3.7.0/setup.py 2011-03-17 14:44:28 UTC (rev 121004)
@@ -0,0 +1,64 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Foundation 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.
+#
+##############################################################################
+# This package is developed by the Zope Toolkit project, documented here:
+# http://docs.zope.org/zopetoolkit
+# When developing and releasing this package, please follow the documented
+# Zope Toolkit policies as described by this documentation.
+##############################################################################
+"""Setup for zope.lifecycleevent package
+"""
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup(
+ name='zope.lifecycleevent',
+ version='3.7.0',
+ url='http://pypi.python.org/pypi/zope.lifecycleevent',
+ author='Zope Foundation and Contributors',
+ author_email='zope-dev at zope.org',
+ license='ZPL 2.1',
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Zope Public License',
+ 'Programming Language :: Python',
+ 'Operating System :: OS Independent',
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Topic :: Software Development',
+ ],
+ description='Object life-cycle events',
+ long_description=\
+ read('src', 'zope', 'lifecycleevent', 'README.txt')
+ + '\n\n' +
+ read('CHANGES.txt'),
+
+ packages=find_packages('src'),
+ package_dir={'': 'src'},
+ namespace_packages=['zope',],
+ include_package_data=True,
+ install_requires=['setuptools',
+ 'zope.interface',
+ 'zope.component',
+ 'zope.event'],
+ extras_require=dict(
+ test = [
+ 'zope.component [test]',
+ 'zope.container',
+ ]
+ ),
+ zip_safe=False,
+ )
Deleted: zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/__init__.py
===================================================================
--- zope.lifecycleevent/trunk/src/zope/lifecycleevent/__init__.py 2011-03-17 12:57:36 UTC (rev 121000)
+++ zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/__init__.py 2011-03-17 14:44:28 UTC (rev 121004)
@@ -1,148 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Foundation 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
-"""
-__docformat__ = 'restructuredtext'
-
-from zope.component.interfaces import ObjectEvent
-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 IObjectMovedEvent
-from zope.lifecycleevent.interfaces import IObjectAddedEvent
-from zope.lifecycleevent.interfaces import IObjectRemovedEvent
-from zope.lifecycleevent.interfaces import IAttributes
-from zope.lifecycleevent.interfaces import ISequence
-
-
-class ObjectCreatedEvent(ObjectEvent):
- """An object has been created"""
-
- implements(IObjectCreatedEvent)
-
-
-class Attributes(object) :
- """
- Describes modified attributes of an interface.
-
- >>> from zope.lifecycleevent.interfaces import IObjectMovedEvent
- >>> desc = Attributes(IObjectMovedEvent, "newName", "newParent")
- >>> desc.interface == IObjectMovedEvent
- True
- >>> 'newName' 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.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(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
-
-class ObjectMovedEvent(ObjectEvent):
- """An object has been moved"""
-
- implements(IObjectMovedEvent)
-
- def __init__(self, object, oldParent, oldName, newParent, newName):
- ObjectEvent.__init__(self, object)
- self.oldParent = oldParent
- self.oldName = oldName
- self.newParent = newParent
- self.newName = newName
-
-class ObjectAddedEvent(ObjectMovedEvent):
- """An object has been added to a container"""
-
- implements(IObjectAddedEvent)
-
- def __init__(self, object, newParent=None, newName=None):
- if newParent is None:
- newParent = object.__parent__
- if newName is None:
- newName = object.__name__
- ObjectMovedEvent.__init__(self, object, None, None, newParent, newName)
-
-class ObjectRemovedEvent(ObjectMovedEvent):
- """An object has been removed from a container"""
-
- implements(IObjectRemovedEvent)
-
- def __init__(self, object, oldParent=None, oldName=None):
- if oldParent is None:
- oldParent = object.__parent__
- if oldName is None:
- oldName = object.__name__
- ObjectMovedEvent.__init__(self, object, oldParent, oldName, None, None)
-
Copied: zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/__init__.py (from rev 121003, zope.lifecycleevent/trunk/src/zope/lifecycleevent/__init__.py)
===================================================================
--- zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/__init__.py (rev 0)
+++ zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/__init__.py 2011-03-17 14:44:28 UTC (rev 121004)
@@ -0,0 +1,174 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Foundation 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
+"""
+__docformat__ = 'restructuredtext'
+
+from zope.component.interfaces import ObjectEvent
+from zope.interface import implements, moduleProvides
+from zope.event import notify
+
+from zope.lifecycleevent.interfaces import IZopeLifecycleEvent
+from zope.lifecycleevent.interfaces import IObjectCreatedEvent
+from zope.lifecycleevent.interfaces import IObjectModifiedEvent
+from zope.lifecycleevent.interfaces import IObjectCopiedEvent
+from zope.lifecycleevent.interfaces import IObjectMovedEvent
+from zope.lifecycleevent.interfaces import IObjectAddedEvent
+from zope.lifecycleevent.interfaces import IObjectRemovedEvent
+from zope.lifecycleevent.interfaces import IAttributes
+from zope.lifecycleevent.interfaces import ISequence
+
+
+moduleProvides(IZopeLifecycleEvent)
+
+
+class ObjectCreatedEvent(ObjectEvent):
+ """An object has been created"""
+
+ implements(IObjectCreatedEvent)
+
+
+def created(object):
+ notify(ObjectCreatedEvent(object))
+
+
+class Attributes(object) :
+ """
+ Describes modified attributes of an interface.
+
+ >>> from zope.lifecycleevent.interfaces import IObjectMovedEvent
+ >>> desc = Attributes(IObjectMovedEvent, "newName", "newParent")
+ >>> desc.interface == IObjectMovedEvent
+ True
+ >>> 'newName' 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.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(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
+
+
+def copied(object, original):
+ notify(ObjectCopiedEvent(object, original))
+
+
+class ObjectMovedEvent(ObjectEvent):
+ """An object has been moved"""
+
+ implements(IObjectMovedEvent)
+
+ def __init__(self, object, oldParent, oldName, newParent, newName):
+ ObjectEvent.__init__(self, object)
+ self.oldParent = oldParent
+ self.oldName = oldName
+ self.newParent = newParent
+ self.newName = newName
+
+
+def moved(object, oldParent, oldName, newParent, newName):
+ notify(ObjectCreatedEvent(object, oldParent, oldName, newParent, newName))
+
+
+class ObjectAddedEvent(ObjectMovedEvent):
+ """An object has been added to a container"""
+
+ implements(IObjectAddedEvent)
+
+ def __init__(self, object, newParent=None, newName=None):
+ if newParent is None:
+ newParent = object.__parent__
+ if newName is None:
+ newName = object.__name__
+ ObjectMovedEvent.__init__(self, object, None, None, newParent, newName)
+
+
+def added(object, newParent=None, newName=None):
+ notify(ObjectAddedEvent(object, newParent, newName))
+
+
+class ObjectRemovedEvent(ObjectMovedEvent):
+ """An object has been removed from a container"""
+
+ implements(IObjectRemovedEvent)
+
+ def __init__(self, object, oldParent=None, oldName=None):
+ if oldParent is None:
+ oldParent = object.__parent__
+ if oldName is None:
+ oldName = object.__name__
+ ObjectMovedEvent.__init__(self, object, oldParent, oldName, None, None)
+
+
+def removed(object, oldParent=None, oldName=None):
+ notify(ObjectRemovedEvent(object, oldParent, oldName))
Deleted: zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/interfaces.py
===================================================================
--- zope.lifecycleevent/trunk/src/zope/lifecycleevent/interfaces.py 2011-03-17 12:57:36 UTC (rev 121000)
+++ zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/interfaces.py 2011-03-17 14:44:28 UTC (rev 121004)
@@ -1,88 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002, 2003 Zope Foundation 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
-"""
-__docformat__ = 'restructuredtext'
-
-from zope.interface import Interface, Attribute
-import zope.component.interfaces
-
-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.")
-
-
-##############################################################################
-# Moving Objects
-
-class IObjectMovedEvent(zope.component.interfaces.IObjectEvent):
- """An object has been moved."""
-
- oldParent = Attribute("The old location parent for the object.")
- oldName = Attribute("The old location name for the object.")
- newParent = Attribute("The new location parent for the object.")
- newName = Attribute("The new location name for the object.")
-
-
-##############################################################################
-# Adding objects
-
-class IObjectAddedEvent(IObjectMovedEvent):
- """An object has been added to a container."""
-
-
-##############################################################################
-# Removing objects
-
-
-class IObjectRemovedEvent(IObjectMovedEvent):
- """An object has been removed from a container."""
-
-
-
Copied: zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/interfaces.py (from rev 121003, zope.lifecycleevent/trunk/src/zope/lifecycleevent/interfaces.py)
===================================================================
--- zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/interfaces.py (rev 0)
+++ zope.lifecycleevent/tags/3.7.0/src/zope/lifecycleevent/interfaces.py 2011-03-17 14:44:28 UTC (rev 121004)
@@ -0,0 +1,137 @@
+##############################################################################
+#
+# Copyright (c) 2002, 2003 Zope Foundation 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
+"""
+__docformat__ = 'restructuredtext'
+
+from zope.interface import Interface, Attribute
+import zope.component.interfaces
+
+
+class IZopeLifecycleEvent(Interface):
+
+ def created(object):
+ """Send an IObjectCreatedEvent for `object`."""
+
+ def modified(object, *descriptions):
+ """Send an IObjectModifiedEvent for `object`.
+
+ `descriptions` is a sequence of interfaces or fields which were
+ updated.
+
+ """
+
+ def copied(object, original):
+ """Send an IObjectCopiedEvent for object.
+
+ `original` is the object the copy was created from.
+
+ """
+
+ def moved(object, oldParent, oldName, newParent, newName):
+ """Send an IObjectMovedEvent for object.
+
+ `oldParent` is the container `object` was removed from.
+ `oldName` was the name used to store `object` in `oldParent`.
+ `newParent` is the container `object` was added to.
+ `newName` is the name used to store `object` in `newParent`.
+
+ """
+
+ def added(object, newParent=None, newName=None):
+ """Send an IObjectAddedEvent for object.
+
+ `newParent` is the container `object` was added to.
+ `newName` is the name used to store `object` in the container.
+ These will be determined object.__parent__ and object.__name__
+ if None.
+
+ """
+
+ def removed(object, oldParent=None, oldName=None):
+ """Send an IObjectRemovedEvent for object.
+
+ `oldParent` is the container `object` was removed from.
+ `oldName` was the name used to store `object` in `oldParent`.
+ These will be determined object.__parent__ and object.__name__
+ if None.
+
+ """
+
+
+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.")
+
+
+##############################################################################
+# Moving Objects
+
+class IObjectMovedEvent(zope.component.interfaces.IObjectEvent):
+ """An object has been moved."""
+
+ oldParent = Attribute("The old location parent for the object.")
+ oldName = Attribute("The old location name for the object.")
+ newParent = Attribute("The new location parent for the object.")
+ newName = Attribute("The new location name for the object.")
+
+
+##############################################################################
+# Adding objects
+
+class IObjectAddedEvent(IObjectMovedEvent):
+ """An object has been added to a container."""
+
+
+##############################################################################
+# Removing objects
+
+
+class IObjectRemovedEvent(IObjectMovedEvent):
+ """An object has been removed from a container."""
More information about the checkins
mailing list