[Zope3-checkins] SVN: Zope3/branches/philikon-widget-subdirective/src/zope/ back out revisions 30921 thru 30923. they were supposed to go to the trunk.

Philipp von Weitershausen philikon at philikon.de
Sat Jun 25 12:41:34 EDT 2005


Log message for revision 30924:
  back out revisions 30921 thru 30923. they were supposed to go to the trunk.
  

Changed:
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/container/contained.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/copypastemove/__init__.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/event/dispatching.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/event/tests/placelesssetup.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/event/tests/test_objectevent.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/intid/tests.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/presentation/tests/test_presentation.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/publication/tests/test_zopepublication.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/app/testing/ztapi.py
  U   Zope3/branches/philikon-widget-subdirective/src/zope/component/__init__.py

-=-
Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/container/contained.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/container/contained.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/container/contained.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -143,12 +143,11 @@
        Now we'll register it:
 
          >>> from zope.app.testing import ztapi
-         >>> ztapi.subscribe([None, IObjectMovedEvent], None, handler)
+         >>> ztapi.handle([None, IObjectMovedEvent], handler)
 
        We also register our dispatcher:
 
-         >>> ztapi.subscribe([None, IObjectMovedEvent], None,
-         ...                 dispatchToSublocations)
+         >>> ztapi.handle([None, IObjectMovedEvent], dispatchToSublocations)
 
        We can then call the dispatcher for the root object:
 
@@ -378,11 +377,11 @@
     >>> from zope.app.container.interfaces import IObjectMovedEvent
     >>> from zope.app.testing import ztapi
 
-    >>> ztapi.subscribe([IItem, IObjectAddedEvent], None,
-    ...                 lambda obj, event: obj.setAdded(event))
+    >>> ztapi.handle([IItem, IObjectAddedEvent],
+    ...              lambda obj, event: obj.setAdded(event))
 
-    >>> ztapi.subscribe([IItem, IObjectMovedEvent], None,
-    ...                 lambda obj, event: obj.setMoved(event))
+    >>> ztapi.handle([IItem, IObjectMovedEvent],
+    ...              lambda obj, event: obj.setMoved(event))
 
     >>> item = Item()
 

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/copypastemove/__init__.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/copypastemove/__init__.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/copypastemove/__init__.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -679,12 +679,11 @@
 
       >>> from zope.app.tests import ztapi
       >>> from zope.app.event.interfaces import IObjectCopiedEvent
-      >>> ztapi.subscribe([None, IObjectCopiedEvent], None, handler)
+      >>> ztapi.handle([None, IObjectCopiedEvent], handler)
 
     and this function as a dispatcher:
 
-      >>> ztapi.subscribe([None, IObjectCopiedEvent], None,
-      ...                 dispatchToSublocations)
+      >>> ztapi.handle([None, IObjectCopiedEvent], dispatchToSublocations)
 
     When we notify that our root object has been copied:
 

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/event/dispatching.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/event/dispatching.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/event/dispatching.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -36,8 +36,8 @@
 
   >>> from zope.app.testing import ztapi
   >>> from zope.interface import implementedBy
-  >>> ztapi.subscribe([implementedBy(E1)], None, handler1) # old way
-  >>> ztapi.subscribe((E2,), None, handler2) # new way
+  >>> ztapi.handle([implementedBy(E1)], handler1) # old way
+  >>> ztapi.handle((E2,), handler2) # new way
 
   >>> from zope.event import notify
 
@@ -62,7 +62,6 @@
 import zope.event
 
 def dispatch(*event):
-    # iterating over subscribers assures they get executed
     for ignored in subscribers(event, None):
         pass
 

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/event/tests/placelesssetup.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/event/tests/placelesssetup.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/event/tests/placelesssetup.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -40,8 +40,8 @@
 
     def setUp(self):
         clearEvents()
-        ztapi.subscribe([None], None, events.append)
-        ztapi.subscribe([IObjectEvent], None, objectEventNotify)
+        ztapi.handle([None], events.append)
+        ztapi.handle([IObjectEvent], objectEventNotify)
 
 import zope.testing.cleanup
 zope.testing.cleanup.addCleanUp(clearEvents)

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/event/tests/test_objectevent.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/event/tests/test_objectevent.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/event/tests/test_objectevent.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -70,7 +70,7 @@
         def record(*args):
             events.append(args)
 
-        ztapi.subscribe([IContained, IObjectRemovedEvent], None, record)
+        ztapi.handle([IContained, IObjectRemovedEvent], record)
 
         item = Contained()
         event = ObjectRemovedEvent(item)
@@ -87,7 +87,7 @@
         self.assertEqual([], events)
 
     def testVeto(self):
-        ztapi.subscribe([IObjectEvent], None, objectevent.objectEventNotify)
+        ztapi.handle([IObjectEvent], objectevent.objectEventNotify)
         container = SampleContainer()
         item = Contained()
 
@@ -102,7 +102,7 @@
             self.assertEqual(item, event.object)
             raise Veto
 
-        ztapi.subscribe([IContained, IObjectRemovedEvent], None, callback)
+        ztapi.handle([IContained, IObjectRemovedEvent], callback)
 
         # del container['Fred'] will fire an ObjectRemovedEvent event.
         self.assertRaises(Veto, container.__delitem__, 'Fred')

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/intid/tests.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/intid/tests.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/intid/tests.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -185,7 +185,7 @@
         setSite(self.folder1_1)
 
         events = []
-        ztapi.subscribe([IIntIdRemovedEvent], None, events.append)
+        ztapi.handle([IIntIdRemovedEvent], events.append)
 
         # This should unregister the object in all utilities, not just the
         # nearest one.
@@ -207,7 +207,7 @@
         setSite(self.folder1_1)
 
         events = []
-        ztapi.subscribe([IIntIdAddedEvent], None, events.append)
+        ztapi.handle([IIntIdAddedEvent], events.append)
 
         # This should register the object in all utilities, not just the
         # nearest one.

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/presentation/tests/test_presentation.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/presentation/tests/test_presentation.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/presentation/tests/test_presentation.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -213,8 +213,8 @@
     def test_registerAddSubscriber_template(self):
         ztapi.provideAdapter(ILocation, IPhysicallyLocatable,
                              PhonyPathAdapter)
-        ztapi.subscribe((IPageRegistration, IObjectAddedEvent), None,
-                        PageRegistrationAddSubscriber)
+        ztapi.handle((IPageRegistration, IObjectAddedEvent),
+                     PageRegistrationAddSubscriber)
         registration = PageRegistration(I1, 'test', 'zope.View', "Foo.Bar.A",
                                         template=self.__template)
         
@@ -226,8 +226,8 @@
     def test_registerRemoveSubscriber_template(self):
         ztapi.provideAdapter(ILocation, IPhysicallyLocatable,
                              PhonyPathAdapter)
-        ztapi.subscribe((IPageRegistration, IObjectRemovedEvent), None,
-                        PageRegistrationRemoveSubscriber)
+        ztapi.handle((IPageRegistration, IObjectRemovedEvent),
+                     PageRegistrationRemoveSubscriber)
         registration = PageRegistration(I1, 'test', 'zope.View', "Foo.Bar.A",
                                         template=self.__template)
 

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/publication/tests/test_zopepublication.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/publication/tests/test_zopepublication.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/publication/tests/test_zopepublication.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -484,8 +484,8 @@
 
         set = []
         clear = []
-        ztapi.subscribe([IBeforeTraverseEvent], None, set.append)
-        ztapi.subscribe([IEndRequestEvent], None, clear.append)
+        ztapi.handle([IBeforeTraverseEvent], set.append)
+        ztapi.handle([IEndRequestEvent], clear.append)
 
         ob = object()
 

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/testing/ztapi.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/testing/ztapi.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/testing/ztapi.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -78,7 +78,6 @@
     gsm = zapi.getGlobalSiteManager()
     gsm.subscribe(required, provided, factory)
 
-# BBB: Deprecated. Gone in 3.3
 def handle(required, handler):
     subscribe(required, None, handler)
 
@@ -95,7 +94,7 @@
     provideView(None, None, ITraversable, name, handler)
 
 
-# BBB: Deprecated. Gone in 3.3.
+# BBB: Deprecated. Gone in X3.3.
 from zope.deprecation import deprecated
 
 def provideService(name, service, interface=None):
@@ -106,9 +105,4 @@
     
 deprecated('provideService',
            'The concept of services has been removed. Use utilities instead. '
-           'The reference will be gone in 3.3.')
-
-deprecated('handle',
-           'The handle(required, handler) function as a shorter spelling of '
-           'subscribe(required, None, handler) has been deprecated to avoid '
-           'nomenclature confusion with zope.component.handle.')
+           'The reference will be gone in X3.3.')

Modified: Zope3/branches/philikon-widget-subdirective/src/zope/component/__init__.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/component/__init__.py	2005-06-25 16:36:23 UTC (rev 30923)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/component/__init__.py	2005-06-25 16:41:33 UTC (rev 30924)
@@ -182,9 +182,7 @@
 
 def handle(*objects):
     sitemanager = getSiteManager(None)
-    # iterating over subscribers assures they get executed
-    for ignored in sitemanager.subscribers(objects, None):
-        pass
+    tuple(sitemanager.subscribers(objects, None))
 
 class _adapts_descr(object):
     def __init__(self, interfaces):



More information about the Zope3-Checkins mailing list