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

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


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

Modified Files:
	CachingService.py 
Log Message:
SteveA and Marius G.

We refactored the NamedComponentConfiguration and ComponentConfiguration.
Now, we have NamedConfiguration and NamedComponentConfiguration.

NamedConfigurable is now split into two parts, as appropriate to that
refactoring.

Cleaned up various extraneous imports, and changed various 
self --> wrapped_self. (Interestingly, this act revealed one ContextMethod
that did not in fact need to be a ContextMethod.)
 


=== Zope3/lib/python/Zope/App/OFS/Services/CachingService/CachingService.py 1.7 => 1.8 ===
--- Zope3/lib/python/Zope/App/OFS/Services/CachingService/CachingService.py:1.7	Wed Dec 18 12:35:04 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/CachingService/CachingService.py	Wed Dec 18 15:23:04 2002
@@ -15,23 +15,27 @@
 
 $Id$
 """
+__metaclass__ = type
+
 from Persistence import Persistent
 from Zope.App.Caching.ICachingService import ICachingService
 from Zope.App.ComponentArchitecture.NextService import queryNextService
-from Zope.App.OFS.Services.ConfigurationInterfaces import INameConfigurable
-from Zope.App.OFS.Services.Configuration import NameConfigurable
+from Zope.App.OFS.Services.ConfigurationInterfaces \
+        import INameComponentConfigurable
+from Zope.App.OFS.Services.Configuration import NameComponentConfigurable
 from Zope.App.OFS.Services.LocalEventService.ProtoServiceEventChannel \
-     import ProtoServiceEventChannel
+        import ProtoServiceEventChannel
 from Zope.ContextWrapper import ContextMethod
 from Zope.Event.IEventChannel import IEventChannel
 from Zope.Event.IObjectEvent import IObjectModifiedEvent
 
 
-class ILocalCachingService(ICachingService, IEventChannel, INameConfigurable):
+class ILocalCachingService(ICachingService, IEventChannel,
+                           INameComponentConfigurable):
     """TTW manageable caching service"""
 
 
-class CachingService(ProtoServiceEventChannel, NameConfigurable):
+class CachingService(ProtoServiceEventChannel, NameComponentConfigurable):
 
     __implements__ = (ILocalCachingService,
                       ProtoServiceEventChannel.__implements__)
@@ -39,9 +43,13 @@
     _subscribeToServiceInterface = IObjectModifiedEvent
 
     def __init__(self):
+        # XXX If we know that all the superclasses do the right thing in
+        #     __init__ with respect to calling
+        #     super(ClassName, self).__init__(*args, **kw), then we can
+        #     replace the following with just a call to super.
         Persistent.__init__(self)
         ProtoServiceEventChannel.__init__(self)
-        NameConfigurable.__init__(self)
+        NameComponentConfigurable.__init__(self)
 
     def getCache(wrapped_self, name):
         'See Zope.App.Caching.ICachingService.ICachingService'