[Zope] timeouts and alternatives

Mark McEahern mark@mceahern.com
Wed, 4 Dec 2002 11:29:42 -0600


Suppose I have an object that takes a long time to add (e.g., a highly
customized CMF Site that imports all the data upon creation).  I can go into
the ZMI and add it.  During development, I do this often, but I'd like to be
able do to it from a Python script, so that I don't have to worry about
timeouts--plus, it'd be much easier to just execute a shell script than to
go into the ZMI and click around to delete/add my site for the billionth
time.  The script might look like this:

  #!/bin/bash

  # Update my Products.
  cp -R $dev/Products/* $zope/Products/.

  # Restart Zope.
  /sbin/service zope restart

  # Create the site.
  python2.1 $dev/create_site.py

What I'm wondering, is what does create_site.py look like?  I'm hoping
there's a way to do something like this:

  import ZODB
  # unknown magic that gets me to root = the root of my Zope instance
  root.manage_AddSite(...)

Thanks,

// mark

-