timeouts and alternatives
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 -
import ZODB # unknown magic that gets me to root = the root of my Zope instance root.manage_AddSite(...)
Make ZEO client and do import Zope root = Zope.app() Google for this and you will find some results. If you want to hook the initialization of a clean ZODB, look at PloneInitialize.py in a Plone installation near you. -- Andy McKay
# 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:
Take a look in mips/tools/create_mips_portal.py. I just whipped this together to create the portal from the command line. Its really too bad that their client stuff isn't better documented it makes calling an HTTP server via POST forms easy. BTW, there's a pack.py in PortalCatalog/data/ that packs the database. J
# 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:
My apologies. I accidentally sent the reply to the list instead of privately. Jeff
participants (3)
-
Andy McKay -
Jeff Youel -
Mark McEahern