[Zope3-checkins] CVS: Zope3/src/zope/app/browser/cache - cacheable.py:1.8 configure.zcml:1.12 ram.py:1.3

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Aug 19 14:35:01 EDT 2003


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

Modified Files:
	cacheable.py configure.zcml ram.py 
Log Message:
Just to make it worth the effort, here is the rewrite of the Caching Service
to use local utilities. I am amazed how much cruft can go away. There are
still some dead chickens left that can be easily fixed by providing a 
default overview screen for these services and remodeling the local utility
service a bit.

Jim,

noone has complained about the changes yet. Are you guys at ZC having a fit
with it? I think in general people just not use these components heavily
yet and it is no big deal to create them, since their data does not contain
much programming logic (i.e. they are easily recreated) and there are only
a few around ata time usually.


=== Zope3/src/zope/app/browser/cache/cacheable.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/cache/cacheable.py:1.7	Wed Apr 30 19:37:49 2003
+++ Zope3/src/zope/app/browser/cache/cacheable.py	Tue Aug 19 13:33:56 2003
@@ -15,18 +15,15 @@
 
 $Id$
 """
-
-from zope.component import getAdapter
-from zope.publisher.browser import BrowserView
-
+from zope.app import zapi
 from zope.app.cache.caching import getCacheForObj, getLocationForCache
 from zope.app.form.utility import setUpEditWidgets
+from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.app.interfaces.annotation import IAnnotatable
-from zope.app.interfaces.cache.cache import ICacheable
+from zope.app.interfaces.cache import ICacheable
 from zope.app.interfaces.form import WidgetInputError
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-
-from zope.app.i18n import ZopeMessageIDFactory as _
+from zope.publisher.browser import BrowserView
 
 class CacheableView(BrowserView):
 
@@ -36,7 +33,7 @@
 
     def __init__(self, *args):
         super(CacheableView, self).__init__(*args)
-        self.cacheable = getAdapter(self.context, ICacheable)
+        self.cacheable = zapi.getAdapter(self.context, ICacheable)
         setUpEditWidgets(self, ICacheable, self.cacheable)
 
     def current_cache_id(self):


=== Zope3/src/zope/app/browser/cache/configure.zcml 1.11 => 1.12 ===
--- Zope3/src/zope/app/browser/cache/configure.zcml:1.11	Wed Aug  6 10:41:24 2003
+++ Zope3/src/zope/app/browser/cache/configure.zcml	Tue Aug 19 13:33:56 2003
@@ -1,44 +1,39 @@
-<configure
-   xmlns="http://namespaces.zope.org/zope"
-   xmlns:browser="http://namespaces.zope.org/browser">
+<configure xmlns="http://namespaces.zope.org/browser">
 
-  <!-- Menu entry for "add component" menu -->
-  <browser:menuItem
-      menu="add_component"
-      for="zope.app.interfaces.container.IAdding"
-      title="RAM Cache"
-      action="zope.app.caching.RAMCache" />
 
   <!-- Menu entry for "add cache" menu -->
-  <browser:menuItem
+  <menuItem
       menu="add_cache"
       for="zope.app.interfaces.container.IAdding"
       title="RAM Cache"
-      action="zope.app.caching.RAMCache" />
+      action="zope.caching.RAMCache" />
+
+  <!-- Menu entry for "add utility" menu -->
+  <menuItem
+      menu="add_utility"
+      for="zope.app.interfaces.container.IAdding"
+      title="RAM Cache"
+      action="zope.caching.RAMCache" />
 
-  <browser:pages
+  <pages
       for="zope.app.interfaces.cache.ram.IRAMCache"
       class="zope.app.browser.cache.ram.RAMCacheView"
       permission="zope.Public">
-    <browser:page name="editAction.html" attribute="action" />
-    <browser:page name="index.html" template="ramedit.pt" />
-    <browser:page name="stats.html" template="ramstats.pt" />
-  </browser:pages>
-
-  <browser:menuItems menu="zmi_views"
-     for="zope.app.interfaces.cache.ram.IRAMCache">
-    <browser:menuItem title="Edit" action="index.html"/>
-    <browser:menuItem title="Statistics" action="stats.html"/>
-  </browser:menuItems>
+    <page name="editAction.html" attribute="action" />
+    <page name="index.html" template="ramedit.pt" 
+          menu="zmi_views" title="Edit"/>
+    <page name="stats.html" template="ramstats.pt" 
+          menu="zmi_views" title="Statistics"/>
+  </pages>
 
-  <browser:pages 
+  <pages 
       for="zope.app.interfaces.annotation.IAnnotatable"
       permission="zope.ManageBindings"
       class="zope.app.browser.cache.cacheable.CacheableView">
-    <browser:page name="Caching.html" attribute="form"  
-                  menu="zmi_views" title="Caching" />
-    <browser:page name="ChangeCaching.html" attribute="action" />
-    <browser:page name="InvalidateCache.html" attribute="invalidate" />
-  </browser:pages>
+    <page name="Caching.html" attribute="form"  
+          menu="zmi_views" title="Caching" />
+    <page name="ChangeCaching.html" attribute="action" />
+    <page name="InvalidateCache.html" attribute="invalidate" />
+  </pages>
 
 </configure>


=== Zope3/src/zope/app/browser/cache/ram.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/cache/ram.py:1.2	Wed Dec 25 09:12:28 2002
+++ Zope3/src/zope/app/browser/cache/ram.py	Tue Aug 19 13:33:56 2003
@@ -15,7 +15,6 @@
 
 $Id$
 """
-
 from zope.publisher.browser import BrowserView
 from zope.app.interfaces.cache.ram import IRAMCache
 




More information about the Zope3-Checkins mailing list