[Zope3-Users] Executing code a server startup

Simon Elbaz elbazsimon9 at gmail.com
Sun May 17 18:42:41 EDT 2009


Hi,
I am trying to execute some code at zope3 server startup. Zope3 posts hint
using a  IProcessStartingEvent subscriber in configure.zcml.

Here is an extract of configure.zcml:

<subscriber
      handler="cdcadama.authentication.onStartup"
      for="zope.app.appsetup.interfaces.IProcessStartingEvent"
/>

and the handler definition:

def onStartup(event):
       print 'hello'

The problem is that the function is not called at server startup. But when a
call to notify(zope.app.appsetup.interfaces.ProcessStarting()) is made
later  in the code (after the server starts), it prints 'hello'.

It looks like that the subscriber is registered after the server notifies
the event.

Thanks for your help
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20090518/20f2b497/attachment.html 


More information about the Zope3-users mailing list