Skip to content

Commit 8526e9e

Browse files
author
Richard Jones
committed
better support for demoing mysql/postgresql
1 parent 2fd224b commit 8526e9e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

demo.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Copyright (c) 2003 Richard Jones ([email protected])
44
#
5-
# $Id: demo.py,v 1.9 2004-03-24 05:39:47 richard Exp $
5+
# $Id: demo.py,v 1.10 2004-03-31 23:07:51 richard Exp $
66

77
import sys, os, string, re, urlparse
88
import shutil, socket, errno, BaseHTTPServer
@@ -12,7 +12,24 @@ def install_demo(home, backend):
1212
# create the instance
1313
if os.path.exists(home):
1414
shutil.rmtree(home)
15-
from roundup import init, instance, password
15+
from roundup import init, instance, password, backends
16+
17+
# see if we have further db nuking to perform
18+
module = getattr(backends, backend)
19+
if backend == 'mysql':
20+
class config:
21+
MYSQL_DBHOST = 'localhost'
22+
MYSQL_DBUSER = 'rounduptest'
23+
MYSQL_DBPASSWORD = 'rounduptest'
24+
MYSQL_DBNAME = 'rounduptest'
25+
DATABASE = 'home'
26+
module.db_nuke(config)
27+
elif backend == 'postgresql':
28+
class config:
29+
POSTGRESQL_DATABASE = {'database': 'rounduptest'}
30+
DATABASE = 'home'
31+
module.db_nuke(config, 1)
32+
1633
init.install(home, os.path.join('templates', 'classic'))
1734
# don't have email flying around
1835
os.remove(os.path.join(home, 'detectors', 'nosyreaction.py'))

0 commit comments

Comments
 (0)