[Checkins] SVN: grokui.admin/trunk/src/grokui/admin/tests/events.py Check for grok.IApplicationInitializedEvent.

Uli Fouquet uli at gnufix.de
Sun Jul 4 08:18:52 EDT 2010


Log message for revision 114175:
  Check for grok.IApplicationInitializedEvent.

Changed:
  U   grokui.admin/trunk/src/grokui/admin/tests/events.py

-=-
Modified: grokui.admin/trunk/src/grokui/admin/tests/events.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/events.py	2010-07-04 09:28:33 UTC (rev 114174)
+++ grokui.admin/trunk/src/grokui/admin/tests/events.py	2010-07-04 12:18:52 UTC (rev 114175)
@@ -13,14 +13,21 @@
 
   >>> browser.open("http://localhost/")
 
-When we create a new instance of our app, the eventhandler defined
+When we create a new instance of our app, the eventhandlers defined
 below will be called:
 
   >>> subform = browser.getForm(name='grokui.admin.tests.events.App')
   >>> subform.getControl(name='name').value = 'my-app'
   >>> subform.getControl('Create').click()
   ObjectCreated event happened.
+  ApplicationInitialized event happened.
 
+While the first event (of type `grok.ObjectCreatedEvent`) tells us
+that an application was created (but might not be completely
+initialized by this time with regard to catalogs and IntIds, the
+second event (of type `grok.ApplicationInitializedEvent`) is fired,
+when the application is completely ready for use.
+
 """
 import grok
 
@@ -32,3 +39,7 @@
 @grok.subscribe(App, grok.IObjectCreatedEvent)
 def handle_my_event(obj, event):
     print "ObjectCreated event happened."
+
+ at grok.subscribe(App, grok.ApplicationInitializedEvent)
+def handle_app_initialized_event(obj, event):
+    print "ApplicationInitialized event happened."



More information about the checkins mailing list