In our project we have a supervisor-utility (started first by zcml..)
and some other utilities which creation is logged to this
hope, this helps
"""initialisation of cron utility on first database startup
dummy_db, connection, dummy_root, root_folder = \
madeIkAdmUtilCron = ensureUtility( root_folder, IIkAdmUtilCron,
'IkAdmUtilCron', IkAdmUtilCron, '',
if isinstance(madeIkAdmUtilCron, IkAdmUtilCron):
logger.info( u"bootstrap: Ensure named IkAdmUtilCron")
dcore = IWriteZopeDublinCore(madeIkAdmUtilCron)
dcore.title = u"IKOMtrol Timer"
dcore.created = datetime.now(berlinTZ)
sitem = root_folder.getSiteManager()
utils = [ util for util in sitem.registeredUtilities()
instIkAdmUtilSupervisor = utils.component
u" bootstrap: made IIkAdmUtilCron-Utility")
Am Dienstag, 19. Juni 2007 15:53 schrieb Jan-Wijbrand Kolman:
> I'm trying to implement a global utility that makes use of other
> global utilities when it is created. In other words, the __init__ of
> my utility class, tries to get to other utilities.
> This does not work however, as the utilities I'd like to get are not
> registered yet when my own utility is created - even if I made sure
> the registrations for the other utilities would've been performed
> before "my" utility is registered.
> I tried to find the reason and I think I found it: when the zcml
> directive for a utility is read, an action object is created. Somewhat
> later in the configuration process these action objects are executed
> and the actual utility registration takes place.
> It is when the action object is created that "my" utility is
> instantiated. And of course, no other actual registrations were made
> yet at that point, because no actions have been executed yet, so not
> utilities are available to make use of.
> Is there a way to overcome this? (or to put it differently, why is
> "my" utility created when the action object is created and not just
> before the actual registration?)
> kind regards,
Zope3-users mailing list