[Zope-Checkins] SVN: Zope/trunk/ sending DatabaseOpened event during the startup

Andreas Jung andreas at andreas-jung.com
Thu Dec 27 09:25:40 EST 2007


Log message for revision 82468:
  sending DatabaseOpened event during the startup
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Zope2/App/startup.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt	2007-12-27 13:57:02 UTC (rev 82467)
+++ Zope/trunk/doc/CHANGES.txt	2007-12-27 14:25:40 UTC (rev 82468)
@@ -78,9 +78,8 @@
 
     Features added
 
-      - Zope2 startup: Zope will now send a ProcessStarting event when it 
-        is ready to serve requests. You can subscribe to this event e.g.
-        for starting application-level threads. 
+      - Zope2 startup: Zope will now send DatabaseOpened and    
+        ProcessStarting events.
 
       - Testing.ZopeTestCase: Introduced a "ZopeLite" test layer, making it
         possible to mix ZTC and non-ZTC tests much more freely.

Modified: Zope/trunk/lib/python/Zope2/App/startup.py
===================================================================
--- Zope/trunk/lib/python/Zope2/App/startup.py	2007-12-27 13:57:02 UTC (rev 82467)
+++ Zope/trunk/lib/python/Zope2/App/startup.py	2007-12-27 14:25:40 UTC (rev 82468)
@@ -38,6 +38,9 @@
 import Zope2
 import ZPublisher
 
+from zope.event import notify
+from zope.app import appsetup
+
 app = None
 startup_time = asctime()
 
@@ -74,6 +77,8 @@
         else:
             DB = ZODB.DB(m.Storage, databases=databases)
 
+    notify(appsetup.interfaces.DatabaseOpened(DB))
+
     Globals.BobobaseName = DB.getName()
 
     if DB.getActivityMonitor() is None:



More information about the Zope-Checkins mailing list