[Zope3-checkins] CVS: Zope3/src/zope/app/cache/interfaces - __init__.py:1.4

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Mar 10 14:41:34 EST 2004


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

Modified Files:
	__init__.py 
Log Message:


Removed the caching service. It was not providing much value anyways, so it was
easy.



Also, I updated the views in a way that SQL Script's chace support would work
again.



There is still much to do:



- zope.app.cache.caching does not have a formally defined API (interface)



- The CacheName field should be a vocabulary field.



- Views need to be updated to current form.


=== Zope3/src/zope/app/cache/interfaces/__init__.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/cache/interfaces/__init__.py:1.3	Tue Mar  2 13:50:55 2004
+++ Zope3/src/zope/app/cache/interfaces/__init__.py	Wed Mar 10 14:41:01 2004
@@ -21,20 +21,17 @@
 
 from zope.app import zapi
 from zope.app.event.interfaces import ISubscriber
-from zope.app.services.servicenames import Caching
 
+# XXX: EEEEEEEEK, should be done using a vocabulary and the vocabulary field. :(
 class CacheName(TextLine):
     """Cache Name"""
 
     def __allowed(self):
         """Note that this method works only if the Field is context wrapped.
         """
-        try:
-            service = zapi.getService(self.context, Caching)
-        except ComponentLookupError, err:
-            return ['']
-        else:
-            return [''] + list(service.getAvailableCaches())
+        names = [name \
+                 for name, util in zapi.getUtilitiesFor(self.context, ICache)]
+        return names + ['']
 
     allowed_values = property(__allowed)
 
@@ -52,19 +49,6 @@
 
     def setCacheId(id):
         """Sets the associated cache manager ID."""
-
-
-class ICachingService(Interface):
-
-    def getCache(name):
-        """Returns a cache object by name."""
-
-    def queryCache(name, default):
-        """Return a cache object by name or default."""
-
-    def getAvailableCaches():
-        """Returns a list of names of cache objects known to this caching
-        service."""
 
 
 class ICache(ISubscriber):




More information about the Zope3-Checkins mailing list