From 410f25d3a5e100ff1693fb1ef8f21087a1170b04 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 31 Mar 2004 23:07:51 +0000 Subject: [PATCH] better support for demoing mysql/postgresql git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2237 57a73879-2fb5-44c3-a270-3262357dd7e2 --- demo.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/demo.py b/demo.py index a91be9d..7d7f947 100644 --- a/demo.py +++ b/demo.py @@ -2,7 +2,7 @@ # # Copyright (c) 2003 Richard Jones (richard@mechanicalcat.net) # -# $Id: demo.py,v 1.9 2004-03-24 05:39:47 richard Exp $ +# $Id: demo.py,v 1.10 2004-03-31 23:07:51 richard Exp $ import sys, os, string, re, urlparse import shutil, socket, errno, BaseHTTPServer @@ -12,7 +12,24 @@ def install_demo(home, backend): # create the instance if os.path.exists(home): shutil.rmtree(home) - from roundup import init, instance, password + from roundup import init, instance, password, backends + + # see if we have further db nuking to perform + module = getattr(backends, backend) + if backend == 'mysql': + class config: + MYSQL_DBHOST = 'localhost' + MYSQL_DBUSER = 'rounduptest' + MYSQL_DBPASSWORD = 'rounduptest' + MYSQL_DBNAME = 'rounduptest' + DATABASE = 'home' + module.db_nuke(config) + elif backend == 'postgresql': + class config: + POSTGRESQL_DATABASE = {'database': 'rounduptest'} + DATABASE = 'home' + module.db_nuke(config, 1) + init.install(home, os.path.join('templates', 'classic')) # don't have email flying around os.remove(os.path.join(home, 'detectors', 'nosyreaction.py')) -- 2.30.2