[Zope3-checkins] SVN: Zope3/trunk/ Rename the event to reflect it's purpose and remove non-functional component declarations

Martijn Pieters mj at zopatista.com
Mon Jul 31 04:57:45 EDT 2006


Log message for revision 69305:
  Rename the event to reflect it's purpose and remove non-functional component declarations

Changed:
  U   Zope3/trunk/doc/CHANGES.txt
  U   Zope3/trunk/src/zope/app/session/configure.zcml
  U   Zope3/trunk/src/zope/app/session/http.py
  U   Zope3/trunk/src/zope/publisher/http.py
  U   Zope3/trunk/src/zope/publisher/interfaces/http.py

-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt	2006-07-30 20:19:17 UTC (rev 69304)
+++ Zope3/trunk/doc/CHANGES.txt	2006-07-31 08:57:41 UTC (rev 69305)
@@ -12,8 +12,9 @@
 
       - Added new Time field type to zope.schema
 
-      - IHTTPApplicationRequests emit a new event, IHTTPVirtualHostChanged,
-        when virtual host parameters are altered.
+      - IHTTPApplicationRequests emit a new event,
+        IHTTPVirtualHostChangedEvent, when virtual host parameters are 
+        altered.
 
     Restructuring
 
@@ -77,7 +78,7 @@
       - Fixed issue 543: add 'decimal'-package to
         zope/app/security/globalmodules.zcml
 
-      - Fixed issue 679: using the new IHTTPVirtualHostChanged event, session's
+      - Fixed issue 679: using the new IHTTPVirtualHostChangedEvent, session's
         cliend id cookies fix up the set cookie path whenever the virtual host
         information changes during a request.
 

Modified: Zope3/trunk/src/zope/app/session/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/session/configure.zcml	2006-07-30 20:19:17 UTC (rev 69304)
+++ Zope3/trunk/src/zope/app/session/configure.zcml	2006-07-31 08:57:41 UTC (rev 69305)
@@ -90,7 +90,7 @@
       />
       
   <subscriber
-      for="zope.publisher.interfaces.http.IHTTPVirtualHostChanged"
+      for="zope.publisher.interfaces.http.IHTTPVirtualHostChangedEvent"
       handler=".http.notifyVirtualHostChanged"
       />
 

Modified: Zope3/trunk/src/zope/app/session/http.py
===================================================================
--- Zope3/trunk/src/zope/app/session/http.py	2006-07-30 20:19:17 UTC (rev 69304)
+++ Zope3/trunk/src/zope/app/session/http.py	2006-07-31 08:57:41 UTC (rev 69305)
@@ -29,7 +29,7 @@
 from zope.interface import implements
 from zope.publisher.interfaces.http import IHTTPRequest
 from zope.publisher.interfaces.http import IHTTPApplicationRequest
-from zope.publisher.interfaces.http import IHTTPVirtualHostChanged
+from zope.publisher.interfaces.http import IHTTPVirtualHostChangedEvent
 from zope.annotation.interfaces import IAttributeAnnotatable
 
 from zope.app.i18n import ZopeMessageFactory as _
@@ -274,7 +274,6 @@
                     path=request.getApplicationURL(path_only=True)
                     )
 
- at component.adapter(IHTTPVirtualHostChanged)
 def notifyVirtualHostChanged(event):
     """Adjust cookie paths when IVirtualHostRequest information changes.
     

Modified: Zope3/trunk/src/zope/publisher/http.py
===================================================================
--- Zope3/trunk/src/zope/publisher/http.py	2006-07-30 20:19:17 UTC (rev 69304)
+++ Zope3/trunk/src/zope/publisher/http.py	2006-07-31 08:57:41 UTC (rev 69305)
@@ -33,7 +33,7 @@
 from zope.publisher.interfaces.http import IHTTPRequest
 from zope.publisher.interfaces.http import IHTTPApplicationRequest
 from zope.publisher.interfaces.http import IHTTPPublisher
-from zope.publisher.interfaces.http import IHTTPVirtualHostChanged
+from zope.publisher.interfaces.http import IHTTPVirtualHostChangedEvent
 
 from zope.publisher.interfaces import Redirect
 from zope.publisher.interfaces.http import IHTTPResponse
@@ -76,9 +76,8 @@
         dict['PATH_INFO'] = dict['PATH_INFO'].decode('utf-8')
     return dict
 
-class HTTPVirtualHostChanged(object):
-    interface.implements(IHTTPVirtualHostChanged)
-    component.adapts(IHTTPApplicationRequest)
+class HTTPVirtualHostChangedEvent(object):
+    interface.implements(IHTTPVirtualHostChangedEvent)
     
     request = None
     
@@ -562,7 +561,7 @@
         if port and str(port) != DEFAULT_PORTS.get(proto):
             host = '%s:%s' % (host, port)
         self._app_server = '%s://%s' % (proto, host)
-        event.notify(HTTPVirtualHostChanged(self))
+        event.notify(HTTPVirtualHostChangedEvent(self))
 
     def shiftNameToApplication(self):
         """Add the name being traversed to the application name
@@ -573,7 +572,7 @@
         """
         if len(self._traversed_names) == 1:
             self._app_names.append(self._traversed_names.pop())
-            event.notify(HTTPVirtualHostChanged(self))
+            event.notify(HTTPVirtualHostChangedEvent(self))
             return
 
         raise ValueError("Can only shift leading traversal "
@@ -583,7 +582,7 @@
         del self._traversed_names[:]
         self._vh_root = self._last_obj_traversed
         self._app_names = list(names)
-        event.notify(HTTPVirtualHostChanged(self))
+        event.notify(HTTPVirtualHostChangedEvent(self))
 
     def getVirtualHostRoot(self):
         return self._vh_root

Modified: Zope3/trunk/src/zope/publisher/interfaces/http.py
===================================================================
--- Zope3/trunk/src/zope/publisher/interfaces/http.py	2006-07-30 20:19:17 UTC (rev 69304)
+++ Zope3/trunk/src/zope/publisher/interfaces/http.py	2006-07-31 08:57:41 UTC (rev 69305)
@@ -393,7 +393,7 @@
         constructed from the result.
         """
         
-class IHTTPVirtualHostChanged(Interface):
+class IHTTPVirtualHostChangedEvent(Interface):
     """The host, port and/or the application path have changed.
     
     The request referred to in this event implements at least the 



More information about the Zope3-Checkins mailing list