[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/CachingService - CacheConfiguration.py:1.2 CachingService.py:1.7

Steve Alexander steve@cat-box.net
Wed, 18 Dec 2002 12:35:04 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/CachingService
In directory cvs.zope.org:/tmp/cvs-serv32536

Modified Files:
	CacheConfiguration.py CachingService.py 
Log Message:
Changed self of context methods to wrapped_self.


=== Zope3/lib/python/Zope/App/OFS/Services/CachingService/CacheConfiguration.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/App/OFS/Services/CachingService/CacheConfiguration.py:1.1	Thu Dec 12 10:28:16 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/CachingService/CacheConfiguration.py	Wed Dec 18 12:35:04 2002
@@ -37,17 +37,15 @@
     def __init__(self, *args, **kw):
         super(CacheConfiguration, self).__init__(*args, **kw)
 
-    def activated(self):
-        cache = self.getComponent()
-        service = getService(self, 'Caching')
+    def activated(wrapped_self):
+        cache = wrapped_self.getComponent()
+        service = getService(wrapped_self, 'Caching')
         service.subscribe(cache, IObjectModifiedEvent)
-
     activated = ContextMethod(activated)
 
-    def deactivated(self):
-        cache = self.getComponent()
-        service = getService(self, 'Caching')
+    def deactivated(wrapped_self):
+        cache = wrapped_self.getComponent()
+        service = getService(wrapped_self, 'Caching')
         service.unsubscribe(cache, IObjectModifiedEvent)
         cache.invalidateAll()
-
     deactivated = ContextMethod(deactivated)


=== Zope3/lib/python/Zope/App/OFS/Services/CachingService/CachingService.py 1.6 => 1.7 ===
--- Zope3/lib/python/Zope/App/OFS/Services/CachingService/CachingService.py:1.6	Wed Dec 18 12:32:26 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/CachingService/CachingService.py	Wed Dec 18 12:35:04 2002
@@ -43,33 +43,33 @@
         ProtoServiceEventChannel.__init__(self)
         NameConfigurable.__init__(self)
 
-    def getCache(self, name):
+    def getCache(wrapped_self, name):
         'See Zope.App.Caching.ICachingService.ICachingService'
-        cache = self.queryActiveComponent(name)
+        cache = wrapped_self.queryActiveComponent(name)
         if cache:
             return cache
-        service = queryNextService(self, "Caching")
+        service = queryNextService(wrapped_self, "Caching")
         if service is not None:
             return service.getCache(name)
         raise KeyError, name
     getCache = ContextMethod(getCache)
 
-    def queryCache(self, name, default=None):
+    def queryCache(wrapped_self, name, default=None):
         'See Zope.App.Caching.ICachingService.ICachingService' 
         try:
-            return self.getCache(name)
+            return wrapped_self.getCache(name)
         except KeyError:
             return default
     queryCache = ContextMethod(queryCache)
 
-    def getAvailableCaches(self):
+    def getAvailableCaches(wrapped_self):
         'See Zope.App.Caching.ICachingService.ICachingService'
         caches = {}
-        for name in self.listConfigurationNames():
-            registry = self.queryConfigurations(name)
+        for name in wrapped_self.listConfigurationNames():
+            registry = wrapped_self.queryConfigurations(name)
             if registry.active() is not None:
                 caches[name] = 0
-        service = queryNextService(self, "Caching")
+        service = queryNextService(wrapped_self, "Caching")
         if service is not None:
             for name in service.getAvailableCaches():
                 caches[name] = 0