[Zope-dev] moment when zope was started.

Victor Safronovich vsafronovich at naumen.ru
Tue Nov 8 01:12:37 EST 2005


Hello Chris Withers,

Monday, November 7, 2005, 8:15:58 PM, you wrote:

CW> Victor Safronovich wrote:
>> 
>>    But in Zope 2.8 the variable 'Zope2.Startup.started' not changed its value to
>>    True, because Zope2.Startup.start_zope was never called, instead of that called
>>    Zope2.Startup.run.run function.

CW> This sounds like a bug, but why do you want to know this?
  My Product wants to replace zpublisher_validate_hook in Zope2.__init__.
  Formerly I use the code

  class ZPValidateHookReplacer(Thread):
      def run(self):
          while not Zope.Startup.started: # in 2.8 'Zope' module must be replaced to Zope2
              time.sleep(0.5)
          Zope.zpublisher_validate_hook = my_validate_hook
  ZPValidateHookReplacer().start()

  in  Zope  2.8  this  code  was broken because Zope.Startup.started always False. I
  changed  to new repeat condition "while Zope.zpublisher_validate_hook is None: time.sleep(0.5)"
  But what if others use Zope.Startup.started variable?

-- 
Best regards,
 Victor Safronovich
 NauMen.NauDoc.SoftwareDeveloper  http://www.naumen.ru



More information about the Zope-Dev mailing list