Author: jmorliaguet
Date: Sun Jun 25 12:44:44 2006
New Revision: 3519

Modified:
   CPSSkins4Five/trunk/configure.zcml
   CPSSkins4Five/trunk/patches.py

Log:

- add annotations to ZPublisher.HTTPRequest

  if the application already uses REQUEST.annotations, there could be a problem 
though



Modified: CPSSkins4Five/trunk/configure.zcml
==============================================================================
--- CPSSkins4Five/trunk/configure.zcml  (original)
+++ CPSSkins4Five/trunk/configure.zcml  Sun Jun 25 12:44:44 2006
@@ -53,4 +53,9 @@
 
   <five:traversable class="OFS.Folder.Folder" />
 
+  <subscriber
+      for="zope.app.publication.interfaces.BeforeTraverseEvent"
+      handler=".patches.addAnnotationsToRequest"
+  />
+
 </configure>

Modified: CPSSkins4Five/trunk/patches.py
==============================================================================
--- CPSSkins4Five/trunk/patches.py      (original)
+++ CPSSkins4Five/trunk/patches.py      Sun Jun 25 12:44:44 2006
@@ -22,5 +22,11 @@
 
 def bypass(context):
     pass
-
 ThemeManagementFolder.manage_fixupOwnershipAfterAdd = bypass
+
+# add annotations to ZPublisher.HTTPRequest
+_MARKER = object()
+def addAnnotationsToRequest(event):
+    request = event.request
+    if request.get(u'annotations', _MARKER) is _MARKER:
+        request.annotations = {}
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to