Author: jmorliaguet
Date: Mon Oct  3 23:52:32 2005
New Revision: 27896

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
Log:

- moved the layout's traverse() method to elements.formats



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       
Mon Oct  3 23:52:32 2005
@@ -96,8 +96,13 @@
         return self
 
     def traverse(self, name, remaining):
+        context = self.context
         if name in format_registry:
             return self.getFormat(name)
+        if hasattr(context, 'get'):
+            value = context.get(name)
+            if value is not None:
+                return value
         return getattr(self, name)
 
     def storeFormat(self, format=None):

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     
Mon Oct  3 23:52:32 2005
@@ -31,9 +31,6 @@
 class ILayout(IFormat, IContainer):
     """A layout element"""
 
-    def traverse(name, remaining):
-       """Return the value of layout attributes"""
-
     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 Mon Oct 
 3 23:52:32 2005
@@ -18,7 +18,6 @@
 __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
@@ -51,7 +50,7 @@
     {u'width': '', u'text-align': '', u'height': ''}
 
     """
-    implements(ILayout, ITraversable)
+    implements(ILayout)
 
     __super_setitem = BTreeContainer.__setitem__
 
@@ -62,9 +61,6 @@
         Format.__init__(self, id=id)
         self._resetFields()
 
-    def traverse(self, name, remaining):
-        return str(self.get(name))
-
     def __repr__(self):
         return "Layout('%s')" % self.getLayoutId()
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to