[Zope3-checkins] CVS: Zope3/src/zope/app/services - configure.zcml:1.44 module.py:1.11
Fred L. Drake, Jr.
fred@zope.com
Thu, 26 Jun 2003 15:11:50 -0400
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv27884
Modified Files:
configure.zcml module.py
Log Message:
Re-enable the persistent module import hook.
=== Zope3/src/zope/app/services/configure.zcml 1.43 => 1.44 ===
--- Zope3/src/zope/app/services/configure.zcml:1.43 Thu Jun 26 10:51:34 2003
+++ Zope3/src/zope/app/services/configure.zcml Thu Jun 26 15:11:49 2003
@@ -1,5 +1,6 @@
<zopeConfigure
xmlns='http://namespaces.zope.org/zope'
+ xmlns:event='http://namespaces.zope.org/event'
xmlns:fssync='http://namespaces.zope.org/fssync'
>
@@ -545,5 +546,11 @@
<!-- Local Interface Service -->
<include file="interface.zcml" />
+
+<!-- Enable import of persistent modules -->
+<event:subscribe
+ subscriber=".module.installPersistentModuleImporter"
+ event_types="zope.app.interfaces.event.IProcessStartingEvent"
+ />
</zopeConfigure>
=== Zope3/src/zope/app/services/module.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/services/module.py:1.10 Mon Jun 2 13:45:10 2003
+++ Zope3/src/zope/app/services/module.py Thu Jun 26 15:11:49 2003
@@ -27,6 +27,7 @@
from zope.interface import implements
+from zope.app.event import function
from zope.app.fssync.classes import ObjectEntryAdapter, AttrMapping
from zope.app.interfaces.fssync import IObjectFile
from zope.app.interfaces.file import IFileFactory
@@ -140,3 +141,13 @@
m = ContextWrapper(m, self.context)
m.new(name, data)
return m
+
+
+# Installer function that can be called from ZCML:
+
+def installPersistentModuleImporter(event):
+ from zodb.code.module import PersistentModuleImporter
+ PersistentModuleImporter().install()
+
+installPersistentModuleImporter = function.Subscriber(
+ installPersistentModuleImporter)