diff roundup/init.py @ 2633:a9e1fff1e793

I thought I committed this last night. Ho hum. - This implements most of the rest of the new tracker config layout: - dbinit.py split between schema.py and initial_data.py - interfaces.py gone - tracker and detectors __init__.py gone - Added some missing functionality to backends: db_exists test and db_nuke. - Implemented configuration file options in postgresql backend. - Cleaned up tracker initialisation a lot.
author Richard Jones <richard@users.sourceforge.net>
date Tue, 27 Jul 2004 00:57:19 +0000
parents fc52d57c6c3e
children 4c08ca1e2460
line wrap: on
line diff
--- a/roundup/init.py	Tue Jul 27 00:45:49 2004 +0000
+++ b/roundup/init.py	Tue Jul 27 00:57:19 2004 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: init.py,v 1.29 2004-02-11 23:55:08 richard Exp $
+# $Id: init.py,v 1.30 2004-07-27 00:57:18 richard Exp $
 
 """Init (create) a roundup instance.
 """
@@ -159,20 +159,13 @@
 def write_select_db(instance_home, backend):
     ''' Write the file that selects the backend for the tracker
     '''
-    # now select database
-    db = '''# WARNING: DO NOT EDIT THIS FILE!!!
-from roundup.backends.back_%s import Database, Class, FileClass, IssueClass
-'''%backend
-    open(os.path.join(instance_home, 'select_db.py'), 'w').write(db)
+    dbdir = os.path.join(instance_home, 'db')
+    if not os.path.exists(dbdir):
+        os.makedirs(dbdir)
+    f = open(os.path.join(dbdir, 'backend_name'), 'w')
+    f.write(backend+'\n')
+    f.close()
 
 
-def initialise(instance_home, adminpw):
-    '''Initialise an instance's database
-
-    adminpw    - the password for the "admin" user
-    '''
-    # now import the instance and call its init
-    instance = roundup.instance.open(instance_home)
-    instance.init(password.Password(adminpw))
 
 # vim: set filetype=python ts=4 sw=4 et si

Roundup Issue Tracker: http://roundup-tracker.org/