[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/ Hack to make reprs backward compatible so as not to break tests.

Jim Fulton jim at zope.com
Wed Apr 26 14:49:37 EDT 2006


Log message for revision 67627:
  Hack to make reprs backward compatible so as not to break tests.
  
  Obviously, we need better facilities for dealing with event tests.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/component/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/lifecycleevent/__init__.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/component/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/interfaces.py	2006-04-26 18:49:33 UTC (rev 67626)
+++ Zope3/branches/jim-adapter/src/zope/component/interfaces.py	2006-04-26 18:49:36 UTC (rev 67627)
@@ -45,12 +45,13 @@
 class ObjectEvent(object):
     interface.implements(IObjectEvent)
 
+    # for repr backward compatibility. In the next release cycle, we'll
+    # provide a testing framework that addresses repr migration.
+    __module__ = 'zope.app.event.objectevent'
+
     def __init__(self, object):
         self.object = object
 
-    def __repr__(self):
-        return "%s event:\n%r" % (self.__class__.__name__, self.object)
-
 class IComponentArchitecture(interface.Interface):
     """The Component Architecture is defined by two key components: Adapters
     and Utiltities. Both are managed by site managers. All other components
@@ -559,6 +560,9 @@
     """
     interface.implements(IRegistrationEvent)
 
+    def __repr__(self):
+        return "%s event:\n%r" % (self.__class__.__name__, self.object)
+
 class IRegistered(IRegistrationEvent):
     """A component or factory was registered 
     """

Modified: Zope3/branches/jim-adapter/src/zope/lifecycleevent/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/lifecycleevent/__init__.py	2006-04-26 18:49:33 UTC (rev 67626)
+++ Zope3/branches/jim-adapter/src/zope/lifecycleevent/__init__.py	2006-04-26 18:49:36 UTC (rev 67627)
@@ -49,6 +49,10 @@
 class ObjectCreatedEvent(zope.component.interfaces.ObjectEvent):
     """An object has been created"""
 
+    # for repr backward compatibility. In the next release cycle, we'll
+    # provide a testing framework that addresses repr migration.
+    __module__ = 'zope.app.event.objectevent'
+
     implements(IObjectCreatedEvent)
 
 
@@ -94,6 +98,10 @@
 class ObjectModifiedEvent(zope.component.interfaces.ObjectEvent):
     """An object has been modified"""
 
+    # for repr backward compatibility. In the next release cycle, we'll
+    # provide a testing framework that addresses repr migration.
+    __module__ = 'zope.app.event.objectevent'
+
     implements(IObjectModifiedEvent)
 
     def __init__(self, object, *descriptions) :
@@ -122,6 +130,10 @@
 class ObjectCopiedEvent(ObjectCreatedEvent):
     """An object has been copied"""
 
+    # for repr backward compatibility. In the next release cycle, we'll
+    # provide a testing framework that addresses repr migration.
+    __module__ = 'zope.app.event.objectevent'
+
     implements(IObjectCopiedEvent)
 
     def __init__(self, object, original):



More information about the Zope3-Checkins mailing list