[Zope3-checkins] CVS: Zope3/src/zope/app - dependable.py:1.7

Jim Fulton jim at zope.com
Sat Mar 6 11:50:42 EST 2004


Update of /cvs-repository/Zope3/src/zope/app
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/app

Modified Files:
	dependable.py 
Log Message:
Converted most getAdapter calls to use interface calls instead.


=== Zope3/src/zope/app/dependable.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/dependable.py:1.6	Sun Sep 21 13:30:12 2003
+++ Zope3/src/zope/app/dependable.py	Sat Mar  6 11:50:11 2004
@@ -20,7 +20,6 @@
 from zope.app.interfaces.dependable import IDependable
 from zope.app.interfaces.annotation import IAnnotations
 from zope.app.traversing import getParent, canonicalPath, getPath
-from zope.component import getAdapter
 from zope.interface import implements
 
 
@@ -50,7 +49,7 @@
 
     def addPath(self, path):
         path = self._make_relative(path)
-        annotations = getAdapter(self.context, IAnnotations)
+        annotations = IAnnotations(self.context)
         old = annotations.get(self.key, ())
         fixed = map(self._make_relative, old)
         if path not in fixed:
@@ -61,7 +60,7 @@
 
     def removePath(self, path):
         path = self._make_relative(path)
-        annotations = getAdapter(self.context, IAnnotations)
+        annotations = IAnnotations(self.context)
         old = annotations.get(self.key, ())
         if old:
             fixed = map(self._make_relative, old)
@@ -74,7 +73,7 @@
                     del annotations[self.key]
 
     def getPaths(self):
-        annotations = getAdapter(self.context, IAnnotations)
+        annotations = IAnnotations(self.context)
         locs = annotations.get(self.key, ())
         return tuple(map(self._make_absolute, locs))
 




More information about the Zope3-Checkins mailing list