diff roundup-admin @ 51:3a7e5515c1bd

ok, so now "./roundup-admin init" will ask questions... ...in an attempt to get a workable instance_home set up :) _and_ anydbm has had its first test :)
author Richard Jones <richard@users.sourceforge.net>
date Mon, 23 Jul 2001 08:45:28 +0000
parents 671203878652
children 0791d13baea7
line wrap: on
line diff
--- a/roundup-admin	Mon Jul 23 08:25:33 2001 +0000
+++ b/roundup-admin	Mon Jul 23 08:45:28 2001 +0000
@@ -1,6 +1,6 @@
 #! /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:
@@ -34,7 +34,7 @@
     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
@@ -130,9 +130,6 @@
         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]
@@ -141,12 +138,30 @@
     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)
@@ -277,6 +292,11 @@
 
 #
 # $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
 #

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