[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Caching/RAMCache - RAMCache.py:1.8
Albertas Agejevas
alga@codeworks.lt
Fri, 6 Dec 2002 04:54:15 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Caching/RAMCache
In directory cvs.zope.org:/tmp/cvs-serv436
Modified Files:
RAMCache.py
Log Message:
Regard only ObjectModification events
=== Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py 1.7 => 1.8 ===
--- Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py:1.7 Tue Dec 3 09:43:57 2002
+++ Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py Fri Dec 6 04:54:14 2002
@@ -22,6 +22,7 @@
from Zope.ComponentArchitecture import getAdapter
from Zope.ComponentArchitecture.Exceptions import ComponentLookupError
from Zope.App.Traversing.IPhysicallyLocatable import IPhysicallyLocatable
+from Zope.Event.IObjectEvent import IObjectModifiedEvent
# A global caches dictionary shared between threads
caches = {}
@@ -143,7 +144,6 @@
return tuple(items)
return ()
-
_buildKey = staticmethod(_buildKey)
def notify(self, event):
@@ -153,13 +153,8 @@
cached entries for the objects that raise them.
"""
- try:
- locatable = getAdapter(event.object, IPhysicallyLocatable)
- except ComponentLookupError:
- pass
- else:
- location = locatable.getPhysicalPath()
- self._getStorage().invalidate(location)
+ if IObjectModifiedEvent.isImplementedBy(event):
+ self._getStorage().invalidate(event.location)
class Storage: