Author: jmorliaguet
Date: Sat Jun 10 17:20:34 2006
New Revision: 3390

Modified:
   cpsskins/branches/paris-sprint-2006/setup/configure.zcml
   cpsskins/branches/paris-sprint-2006/setup/preset.py

Log:

- stop the event propagation to preset sublocations



Modified: cpsskins/branches/paris-sprint-2006/setup/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/configure.zcml    (original)
+++ cpsskins/branches/paris-sprint-2006/setup/configure.zcml    Sat Jun 10 
17:20:34 2006
@@ -33,6 +33,11 @@
       factory="cpsskins.setup.adapters.Resource"
   />
 
+  <!-- event propagation to sublocationsfor presets  -->
+  <adapter
+      factory=".preset.Sublocations"
+  />
+
   <!-- this adapter makes presets identifiable -->
   <adapter
       factory="cpsskins.setup.adapters.Identifiable"

Modified: cpsskins/branches/paris-sprint-2006/setup/preset.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/preset.py (original)
+++ cpsskins/branches/paris-sprint-2006/setup/preset.py Sat Jun 10 17:20:34 2006
@@ -19,6 +19,8 @@
 
 from persistent import Persistent
 from zope.app.container.contained import Contained
+from zope.app.location.interfaces import ISublocations
+from zope.component import adapts
 from zope.interface import implements
 from zope.location.location import locate
 
@@ -89,3 +91,16 @@
     def __init__(self, **kw):
         super(LocalPreset, self).__init__(**kw)
 
+class Sublocations(object):
+    """Get the sublocations of the preset.
+    We return None to stop event propagation to sublocations.
+    """
+    adapts(IPreset)
+    implements(ISublocations)
+
+    def __init__(self, context):
+        pass
+
+    def sublocations(self):
+        yield None
+
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to