[Checkins] SVN: zope.app.cache/trunk/src/zope/app/cache/caching.py
Substitute zope.app.zapi by direct calls to its wrapped apis.
See bug 219302
Lorenzo Gil
lgs at sicem.biz
Sun Apr 20 06:34:13 EDT 2008
Log message for revision 85502:
Substitute zope.app.zapi by direct calls to its wrapped apis. See bug 219302
Changed:
U zope.app.cache/trunk/src/zope/app/cache/caching.py
-=-
Modified: zope.app.cache/trunk/src/zope/app/cache/caching.py
===================================================================
--- zope.app.cache/trunk/src/zope/app/cache/caching.py 2008-04-20 09:56:51 UTC (rev 85501)
+++ zope.app.cache/trunk/src/zope/app/cache/caching.py 2008-04-20 10:34:13 UTC (rev 85502)
@@ -18,11 +18,11 @@
__docformat__ = 'restructuredtext'
from zope.interface import classProvides
-from zope.component import ComponentLookupError
+from zope.component import ComponentLookupError, getUtility
from zope.schema.interfaces import IVocabularyFactory
-from zope.app import zapi
from zope.app.cache.interfaces import ICacheable, ICache
from zope.app.component.vocabulary import UtilityVocabulary
+from zope.traversing.api import getPath
def getCacheForObject(obj):
"""Returns the cache associated with `obj` or ``None``."""
@@ -32,12 +32,12 @@
cache_id = adapter.getCacheId()
if not cache_id:
return None
- return zapi.getUtility(ICache, cache_id)
+ return getUtility(ICache, cache_id)
def getLocationForCache(obj):
"""Returns the location to be used for caching the object or ``None``."""
try:
- return zapi.getPath(obj)
+ return getPath(obj)
except (ComponentLookupError, TypeError):
return None
More information about the Checkins
mailing list