[Zope] How to execute code at startup?

Matthew X. Economou xenophon at irtnog.org
Tue Jun 12 10:36:59 EDT 2007


I have a very simple script that copies my production Zope instance to
a fresh test instance.  I have some Python code that I need to execute
when the test instance starts for the first time (it only needs to
execute once, but it won't hurt Zope if it executes every time the
test instance starts.  I usually execute this code interactively, from
the Zope debugger:

app.restrictedTraverse("/irtnog/portal_cache_settings").setCacheConfig
('zope')

Is there any way to execute this code (or something similar)
automatically?  I guess the alternative is that I could script the
process of entering the Zope debugger and running the above using
Expect or something.

Best wishes,
Matthew

-- 
"Rogues are very keen in their profession, and know already much more
than we can teach them respecting their several kinds of roguery."
  - A. C. Hobbs in _Locks and Safes_ (1853)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4528 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20070612/b9d3ac34/smime.bin


More information about the Zope mailing list