#!/www/python/bin/python """ open/dulcinea/site/update_db.py When we update the live site, this is our procedure. Make a tarball of the running code and database file. This is the emergency kit. Copy the revised code into place. If the code revisions require corresponding data revisions, Copy the database file to a temporary name. Run an update_db.py script that changes attribute names, classes, or whatever is needed to convert the database to agree with the new version of the code. qp -d Move the old database file away. Move the fixed version into place. qp -u Otherwise, there are no data changes, so we just qp -q This script is intended to serve as an example of an update_db.py for a site named "dulcinea". """ from qp.lib.site import Site import sys connection = root = commit = pack = trace = None # This call sets connection, root, commit, pack, and trace. Site('dulcinea').update_db_environment(globals(), *sys.argv[1:]) # Do required changes here. commit() # pack() # optional, but nice if you have time for it.