Skip to content

Commit 4814e3e

Browse files
author
Richard Jones
committed
more metakit fixes
1 parent d718304 commit 4814e3e

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

demo.py

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

77
import sys, os, string, re, urlparse
88
import shutil, socket, errno, BaseHTTPServer
99
from glob import glob
1010

11-
def install_demo(home):
11+
def install_demo(home, backend):
1212
# create the instance
1313
if os.path.exists(home):
1414
shutil.rmtree(home)
@@ -21,7 +21,7 @@ def install_demo(home):
2121
except os.error, error:
2222
if error.errno != errno.ENOENT:
2323
raise
24-
init.write_select_db(home, 'mysql')
24+
init.write_select_db(home, backend)
2525

2626
# figure basic params for server
2727
hostname = socket.gethostname()
@@ -49,12 +49,14 @@ def install_demo(home):
4949
s = f.read().replace('http://tracker.example/cgi-bin/roundup.cgi/bugs/',
5050
url)
5151
f.close()
52+
# DB connection stuff for mysql and postgresql
5253
s = s + """
5354
MYSQL_DBHOST = 'localhost'
5455
MYSQL_DBUSER = 'rounduptest'
5556
MYSQL_DBPASSWORD = 'rounduptest'
5657
MYSQL_DBNAME = 'rounduptest'
5758
MYSQL_DATABASE = (MYSQL_DBHOST, MYSQL_DBUSER, MYSQL_DBPASSWORD, MYSQL_DBNAME)
59+
POSTGRESQL_DATABASE = {'database': 'rounduptest'}
5860
"""
5961
f = open(os.path.join(home, 'config.py'), 'w')
6062
f.write(s)
@@ -77,8 +79,11 @@ def run_demo():
7779
Sets up the web service on localhost. Disables nosy lists.
7880
'''
7981
home = os.path.abspath('demo')
82+
backend = 'anydbm'
8083
if not os.path.exists(home) or sys.argv[-1] == 'nuke':
81-
install_demo(home)
84+
if len(sys.argv) > 2:
85+
backend = sys.argv[1]
86+
install_demo(home, backend)
8287

8388
f = open(os.path.join(home, 'config.py'), 'r')
8489
url = re.search(r'^TRACKER_WEB\s*=\s*[\'"](http.+/)[\'"]$', f.read(),

roundup/backends/back_metakit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.68 2004-03-24 05:33:13 richard Exp $
1+
# $Id: back_metakit.py,v 1.69 2004-03-24 05:39:47 richard Exp $
22
'''Metakit backend for Roundup, originally by Gordon McMillan.
33
44
Known Current Bugs:
@@ -789,7 +789,7 @@ def set_inner(self, nodeid, **propvalues):
789789

790790
if self.do_journal:
791791
if isnew:
792-
self.db.addjournal(self.classname, nodeid, _CREATE, changes)
792+
self.db.addjournal(self.classname, nodeid, _CREATE, {})
793793
else:
794794
self.db.addjournal(self.classname, nodeid, _SET, changes)
795795

0 commit comments

Comments
 (0)