Author: jmorliaguet
Date: Tue Oct  4 01:09:22 2005
New Revision: 27901

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/elements/formats/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/formats/interfaces.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/formats/layout.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py
Log:

- reverted to the original traverse() to avoid side-effects.

- test fixes



Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/formats/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/formats/__init__.py       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/formats/__init__.py       
Tue Oct  4 01:09:22 2005
@@ -100,11 +100,6 @@
         # get a format by name
         if name in format_registry:
             return self.getFormat(name)
-        # get an attribute of the format
-        if hasattr(context, 'get'):
-            value = context.get(name)
-            if value is not None:
-                return value
         # return a method of the adapter
         return getattr(self, name)
 

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/elements/formats/interfaces.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/formats/interfaces.py     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/formats/interfaces.py     
Tue Oct  4 01:09:22 2005
@@ -31,6 +31,9 @@
 class ILayout(IFormat, IContainer):
     """A layout element"""
 
+    def traverse(name, remaining):
+       """Get a layout attribute by traversal."""
+
     def getLayoutId():
        """Return the layout id"""
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/formats/layout.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/formats/layout.py 
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/formats/layout.py Tue Oct 
 4 01:09:22 2005
@@ -18,6 +18,7 @@
 __docformat__ = "reStructuredText"
 
 from zope.app.container.btree import BTreeContainer
+from zope.app.traversing.interfaces import ITraversable
 from zope.interface import implements
 
 from cpsskins.elements.formats import Format
@@ -50,7 +51,7 @@
     {u'width': '', u'text-align': '', u'height': ''}
 
     """
-    implements(ILayout)
+    implements(ILayout, ITraversable)
 
     __super_setitem = BTreeContainer.__setitem__
 
@@ -64,10 +65,10 @@
     def __repr__(self):
         return "Layout('%s')" % self.getLayoutId()
 
-    def get(self, k, default):
-        if k in self._getAllowedKeys():
-            return str(self[k])
-        return default
+    def traverse(self, name, remaining):
+        if name in self._getAllowedKeys():
+            return str(self[name])
+        return None
 
     def __setitem__(self, k, v):
         if not isinstance(v, str):

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py     Tue Oct 
 4 01:09:22 2005
@@ -198,9 +198,6 @@
         readonly=True,
     )
 
-    def getFormatName():
-        """ """
-
     def findDisplays():
         """ """
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to