I have trouble registering utilities which depend on the presence of
other utilities; eg. I have a package A where I want to register utility
B which depends on registration of utility C. 

I tried to register B by putting registration in the __init__.py of A,
which fails because at import time C is not yet registered. 

Registration by subscribing to the utility registration event handler
for C also failed, because by the time the handler gets called, the
utility C is not yet installed. 

My current workaround involves registration upon the IDatabaseOpen
event, which is doubly ugly because Zope 2.10 doesnt send that event out
of the box -- I send it in a monkey-patched Zope2.App.startup module.  

What is the canonical way to do this?

Thanks, 
peter.

_______________________________________________
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to