summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1bc9b48)
raw | patch | inline | side by side (parent: 1bc9b48)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 23 Jul 2001 08:45:28 +0000 (08:45 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 23 Jul 2001 08:45:28 +0000 (08:45 +0000) |
workable instance_home set up :)
_and_ anydbm has had its first test :)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@55 57a73879-2fb5-44c3-a270-3262357dd7e2
_and_ anydbm has had its first test :)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@55 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup-admin | patch | blob | history | |
roundup/init.py | patch | blob | history | |
roundup/templates/extended/dbinit.py | patch | blob | history |
diff --git a/roundup-admin b/roundup-admin
index 16c38ba8e4f138f52496673545e8867945a76525..df9ca5823a528277221d45ba8fc0e7d0e32d115d 100755 (executable)
--- a/roundup-admin
+++ b/roundup-admin
#! /usr/bin/python
-# $Id: roundup-admin,v 1.2 2001-07-23 08:20:44 richard Exp $
+# $Id: roundup-admin,v 1.3 2001-07-23 08:45:28 richard Exp $
import sys
if int(sys.version[0]) < 2:
if message: message = 'Problem: '+message+'\n'
print '''%sUsage:
- roundup [-i instance] init template
+ roundup [-i instance] init [template backend]
-- initialise the database
roundup [-i instance] spec classname
-- show the properties for a classname
n = 3
else:
instance_home = os.environ.get('ROUNDUP_INSTANCE', '')
- if not instance_home:
- usage('No instance home specified')
- return 1
# now figure the command
command = argv[n]
if command == 'init':
adminpw = ''
confirm = 'x'
+ if len(argv) > n:
+ template = argv[n]
+ backend = argv[n+1]
+ else:
+ template = backend = ''
+ while not instance_home:
+ instance_home = raw_input('Enter instance home: ').strip()
+ # TODO: list the templates
+ while not template:
+ template = raw_input('Select template: ').strip()
+ # TODO: list the backends
+ while not backend:
+ backend = raw_input('Select backend: ').strip()
while adminpw != confirm:
- adminpw = getpass.getpass('Admin Password:')
- confirm = getpass.getpass(' Confirm:')
- init.init(instance_home, argv[n], adminpw)
+ adminpw = getpass.getpass('Admin Password: ')
+ confirm = getpass.getpass(' Confirm: ')
+ init.init(instance_home, template, backend, adminpw)
return 0
+ # from here on, we need an instance_home
+ if not instance_home:
+ usage('No instance home specified')
+ return 1
+
# get the instance
path, instance = os.path.split(instance_home)
sys.path.insert(0, path)
#
# $Log: not supported by cvs2svn $
+# Revision 1.2 2001/07/23 08:20:44 richard
+# Moved over to using marshal in the bsddb and anydbm backends.
+# roundup-admin now has a "freshen" command that'll load/save all nodes (not
+# retired - mod hyperdb.Class.list() so it lists retired nodes)
+#
# Revision 1.1 2001/07/23 03:46:48 richard
# moving the bin files to facilitate out-of-the-boxness
#
diff --git a/roundup/init.py b/roundup/init.py
index 5e2d31ca5ab5e56daa5a2b64b0b2e7d103378a6b..d2e39a5d9aa78c214c9b93912490e6ad503ec9db 100644 (file)
--- a/roundup/init.py
+++ b/roundup/init.py
-# $Id: init.py,v 1.2 2001-07-22 12:09:32 richard Exp $
+# $Id: init.py,v 1.3 2001-07-23 08:45:28 richard Exp $
import os, shutil, sys
else:
shutil.copy2(srcname, dstname)
-def init(instance, template, adminpw):
+def init(instance, template, backend, adminpw):
''' initialise an instance using the named template
'''
# first, copy the template dir over
template = os.path.join(template_dir, 'templates', template)
copytree(template, instance)
+ # now select database
+ db = '''# WARNING: DO NOT EDIT THIS FILE!!!
+from roundup.backends.back_%s import Database'''%backend
+ open(os.path.join(instance, 'select_db.py'), 'w').write(db)
+
# now import the instance and call its init
path, instance = os.path.split(instance)
sys.path.insert(0, path)
#
# $Log: not supported by cvs2svn $
+# Revision 1.2 2001/07/22 12:09:32 richard
+# Final commit of Grande Splite
+#
#
index 3684693b840ce3cc08e27bdebfbbddc4033cc8c5..a677082becc9a4b06a20a31d93f1b3fe577d3ffe 100644 (file)
-# $Id: dbinit.py,v 1.3 2001-07-23 07:14:41 richard Exp $
+# $Id: dbinit.py,v 1.4 2001-07-23 08:45:28 richard Exp $
import os
import instance_config
from roundup import roundupdb, cgi_client, mailgw
-from roundup.backends import bsddb
+import select_db
from roundup.roundupdb import Class, FileClass
-class Database(roundupdb.Database, bsddb.Database):
+class Database(roundupdb.Database, select_db.Database):
''' Creates a hybrid database from:
- . the BSDDB implementation in backends.bsddb
+ . the selected database back-end from select_db
. the roundup extensions from roundupdb
'''
pass
#
# $Log: not supported by cvs2svn $
+# Revision 1.3 2001/07/23 07:14:41 richard
+# Moved the database backends off into backends.
+#
# Revision 1.2 2001/07/23 06:25:50 richard
# relfected the move to roundup/backends
#