[Zope3-checkins] CVS: Zope3/src/zope/app/cache -
annotationcacheable.py:1.6 caching.py:1.8
Jim Fulton
jim at zope.com
Sat Mar 6 11:50:47 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/cache
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/app/cache
Modified Files:
annotationcacheable.py caching.py
Log Message:
Converted most getAdapter calls to use interface calls instead.
=== Zope3/src/zope/app/cache/annotationcacheable.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/cache/annotationcacheable.py:1.5 Mon Mar 1 05:57:35 2004
+++ Zope3/src/zope/app/cache/annotationcacheable.py Sat Mar 6 11:50:16 2004
@@ -33,7 +33,7 @@
self._context = context
def getCacheId(self):
- annotations = zapi.getAdapter(self._context, IAnnotations)
+ annotations = IAnnotations(self._context)
return annotations.get(annotation_key, None)
def setCacheId(self, id):
@@ -43,7 +43,7 @@
service = zapi.getService(self._context, Caching)
cache = service.getCache(old_cache_id)
cache.invalidate(self._context)
- annotations = zapi.getAdapter(self._context, IAnnotations)
+ annotations = IAnnotations(self._context)
annotations[annotation_key] = id
cacheId = property(getCacheId, setCacheId, None, "Associated cache name")
=== Zope3/src/zope/app/cache/caching.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/cache/caching.py:1.7 Mon Mar 1 05:57:35 2004
+++ Zope3/src/zope/app/cache/caching.py Sat Mar 6 11:50:16 2004
@@ -22,7 +22,7 @@
def getCacheForObj(obj):
"""Returns the cache associated with obj or None."""
- adapter = zapi.getAdapter(obj, ICacheable)
+ adapter = ICacheable(obj)
cache_id = adapter.getCacheId()
if not cache_id:
return None
More information about the Zope3-Checkins
mailing list