From 8ab27e32c56dd7f3a9368105f65af46b7d2b546d Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 24 Mar 2004 05:39:47 +0000 Subject: [PATCH] more metakit fixes git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2172 57a73879-2fb5-44c3-a270-3262357dd7e2 --- demo.py | 13 +++++++++---- roundup/backends/back_metakit.py | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/demo.py b/demo.py index 517ef00..a91be9d 100644 --- a/demo.py +++ b/demo.py @@ -2,13 +2,13 @@ # # Copyright (c) 2003 Richard Jones (richard@mechanicalcat.net) # -# $Id: demo.py,v 1.8 2004-03-24 03:07:51 richard Exp $ +# $Id: demo.py,v 1.9 2004-03-24 05:39:47 richard Exp $ import sys, os, string, re, urlparse import shutil, socket, errno, BaseHTTPServer from glob import glob -def install_demo(home): +def install_demo(home, backend): # create the instance if os.path.exists(home): shutil.rmtree(home) @@ -21,7 +21,7 @@ def install_demo(home): except os.error, error: if error.errno != errno.ENOENT: raise - init.write_select_db(home, 'mysql') + init.write_select_db(home, backend) # figure basic params for server hostname = socket.gethostname() @@ -49,12 +49,14 @@ def install_demo(home): s = f.read().replace('http://tracker.example/cgi-bin/roundup.cgi/bugs/', url) f.close() + # DB connection stuff for mysql and postgresql s = s + """ MYSQL_DBHOST = 'localhost' MYSQL_DBUSER = 'rounduptest' MYSQL_DBPASSWORD = 'rounduptest' MYSQL_DBNAME = 'rounduptest' MYSQL_DATABASE = (MYSQL_DBHOST, MYSQL_DBUSER, MYSQL_DBPASSWORD, MYSQL_DBNAME) +POSTGRESQL_DATABASE = {'database': 'rounduptest'} """ f = open(os.path.join(home, 'config.py'), 'w') f.write(s) @@ -77,8 +79,11 @@ def run_demo(): Sets up the web service on localhost. Disables nosy lists. ''' home = os.path.abspath('demo') + backend = 'anydbm' if not os.path.exists(home) or sys.argv[-1] == 'nuke': - install_demo(home) + if len(sys.argv) > 2: + backend = sys.argv[1] + install_demo(home, backend) f = open(os.path.join(home, 'config.py'), 'r') url = re.search(r'^TRACKER_WEB\s*=\s*[\'"](http.+/)[\'"]$', f.read(), diff --git a/roundup/backends/back_metakit.py b/roundup/backends/back_metakit.py index a106625..17a47e9 100755 --- a/roundup/backends/back_metakit.py +++ b/roundup/backends/back_metakit.py @@ -1,4 +1,4 @@ -# $Id: back_metakit.py,v 1.68 2004-03-24 05:33:13 richard Exp $ +# $Id: back_metakit.py,v 1.69 2004-03-24 05:39:47 richard Exp $ '''Metakit backend for Roundup, originally by Gordon McMillan. Known Current Bugs: @@ -789,7 +789,7 @@ class Class(hyperdb.Class): if self.do_journal: if isnew: - self.db.addjournal(self.classname, nodeid, _CREATE, changes) + self.db.addjournal(self.classname, nodeid, _CREATE, {}) else: self.db.addjournal(self.classname, nodeid, _SET, changes) -- 2.30.2