[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/traversing/ z.c.adapts() cosmetics

Philipp von Weitershausen philikon at philikon.de
Tue Apr 11 06:04:20 EDT 2006


Log message for revision 66843:
  z.c.adapts() cosmetics
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/traversing/adapters.py
  U   Zope3/branches/jim-adapter/src/zope/traversing/configure.zcml

-=-
Modified: Zope3/branches/jim-adapter/src/zope/traversing/adapters.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/adapters.py	2006-04-11 10:03:07 UTC (rev 66842)
+++ Zope3/branches/jim-adapter/src/zope/traversing/adapters.py	2006-04-11 10:04:19 UTC (rev 66843)
@@ -16,8 +16,10 @@
 $Id$
 """
 from types import StringTypes, MethodType
-from zope.interface import implements
 
+import zope.interface
+import zope.component
+
 from zope.traversing.interfaces import TraversalError
 from zope.traversing.interfaces import IPhysicallyLocatable
 from zope.traversing.interfaces import IContainmentRoot
@@ -32,7 +34,7 @@
 class DefaultTraversable(object):
     """Traverses objects via attribute and item lookup"""
 
-    implements(ITraversable)
+    zope.interface.implements(ITraversable)
 
     def __init__(self, subject):
         self._subject = subject
@@ -54,10 +56,9 @@
 class RootPhysicallyLocatable(object):
     __doc__ = IPhysicallyLocatable.__doc__
 
-    implements(IPhysicallyLocatable)
+    zope.component.adapts(IContainmentRoot)
+    zope.interface.implements(IPhysicallyLocatable)
 
-    __used_for__ = IContainmentRoot
-
     def __init__(self, context):
         self.context = context
 
@@ -81,7 +82,7 @@
 class Traverser(object):
     """Provide traverse features"""
 
-    implements(ITraverser)
+    zope.interface.implements(ITraverser)
 
     # This adapter can be used for any object.
 

Modified: Zope3/branches/jim-adapter/src/zope/traversing/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/configure.zcml	2006-04-11 10:03:07 UTC (rev 66842)
+++ Zope3/branches/jim-adapter/src/zope/traversing/configure.zcml	2006-04-11 10:04:19 UTC (rev 66843)
@@ -10,10 +10,7 @@
     factory="zope.traversing.adapters.DefaultTraversable"
     provides="zope.traversing.interfaces.ITraversable" />
 
-<adapter
-    provides="zope.traversing.interfaces.IPhysicallyLocatable"
-    for="zope.traversing.interfaces.IContainmentRoot"
-    factory="zope.traversing.adapters.RootPhysicallyLocatable" />
+<adapter factory="zope.traversing.adapters.RootPhysicallyLocatable" />
 
 <adapter
     name="etc"



More information about the Zope3-Checkins mailing list