Fw: Re: [z3-five] Refresh and Five

Andy Adiwidjaja mail at adiwidjaja.com
Wed Nov 3 17:25:48 MET 2004


Maybe interesting for someone else also...

Regards,

Andy

--- Forwarded message ---

LR> I have some problems with Five, namely, refresh doesn't seem to work. Is
LR> this normal? If I refresh just the product, all pages seems to 
LR> disappear. I also get an error if I refresh Five...

LR> Any ideas?

This is the normal behaviour. Problem is that the global services
survive the refresh but Five tries to import the configuration. As the
configuration is already loaded, the configuration conflicts.

For development, I use a workaround with a second product. In the
initialize of this product __init__, I clear the services, allowing
to reload the config.

Some code::

  from zope.app.zapi import getGlobalServices
  from Products.Five import zcml

  def resetConfiguration():
      serviceManager = getGlobalServices()
      serviceManager._clear()

  def initialize( context ):
      resetConfiguration()
      print "Reloading Config"
      zcml.load_site()

Note that _clear does only delete the references to the services. If
the services are singletons and do have state, you have to clear them
explicitly. I had this problems with the menu service.

Regards,

Andy



More information about the z3-five mailing list