--On 12. Juni 2007 10:36:59 -0400 "Matthew X. Economou" <xenophon@irtnog.org> wrote:
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.
Why don't you read the related configuration inside *your* code from some configuration file or use a persistent configuration. You can't perform such an operation during the startup phase of Zope. -aj