[Zope3-checkins] CVS: Zope3/src/zope/app/services - configure.zcml:1.36 service.py:1.24
Guido van Rossum
guido@python.org
Wed, 11 Jun 2003 15:33:07 -0400
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv8146
Modified Files:
configure.zcml service.py
Log Message:
Use a custom fssync adapter for the service manager, so that _modules
and _bindings are dumped (as Extra attributes).
=== Zope3/src/zope/app/services/configure.zcml 1.35 => 1.36 ===
--- Zope3/src/zope/app/services/configure.zcml:1.35 Wed Jun 11 13:25:02 2003
+++ Zope3/src/zope/app/services/configure.zcml Wed Jun 11 15:33:06 2003
@@ -498,7 +498,7 @@
<fssync:adapter
class=".service.ServiceManager"
- factory="zope.app.content.fssync.DirectoryAdapter"
+ factory=".service.ServiceManagerAdapter"
/>
<fssync:adapter
=== Zope3/src/zope/app/services/service.py 1.23 => 1.24 ===
--- Zope3/src/zope/app/services/service.py:1.23 Sat Jun 7 01:31:58 2003
+++ Zope3/src/zope/app/services/service.py Wed Jun 11 15:33:06 2003
@@ -49,7 +49,8 @@
from zope.app.interfaces.services.service import IServiceConfiguration
from zope.app.interfaces.services.service import IServiceManager
-# XXX This makes no sense?
+# Declare a tuple of all types we consider to be modules
+# (used as 2nd argument to isinstance() in method resolve() below)
ModuleType = type(IModuleService), PersistentModule
from zope.app.services.configuration import ConfigurationStatusProperty
@@ -65,7 +66,7 @@
implements(IServiceManager, IContainer, IModuleService)
def __init__(self):
- super(ServiceManager, self).__init__()
+ PersistentModuleRegistry.__init__(self)
NameComponentConfigurable.__init__(self)
self.Packages = SiteManagementFolders()
@@ -337,3 +338,20 @@
def usageSummary(self):
return self.name + " Service"
+
+
+# Fssync stuff
+
+from zope.app.fssync.classes import AttrMapping
+from zope.app.content.fssync import DirectoryAdapter
+
+_smattrs = (
+ '_modules', # PersistentModuleRegistry
+ '_bindings', # NameComponentConfigurable
+)
+
+class ServiceManagerAdapter(DirectoryAdapter):
+
+ def extra(self):
+ obj = removeAllProxies(self.context)
+ return AttrMapping(obj, _smattrs)