Mercurial > p > roundup > code
comparison roundup-admin @ 137:4a87e0b0d3f7
Made the "init" prompting more friendly.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 30 Jul 2001 00:04:48 +0000 |
| parents | 0791d13baea7 |
| children | a4383d62a407 |
comparison
equal
deleted
inserted
replaced
| 136:72de483388e3 | 137:4a87e0b0d3f7 |
|---|---|
| 1 #! /usr/bin/python | 1 #! /usr/bin/python |
| 2 # $Id: roundup-admin,v 1.4 2001-07-29 07:01:39 richard Exp $ | 2 # $Id: roundup-admin,v 1.5 2001-07-30 00:04:48 richard Exp $ |
| 3 | 3 |
| 4 import sys | 4 import sys |
| 5 if int(sys.version[0]) < 2: | 5 if int(sys.version[0]) < 2: |
| 6 print 'Roundup requires python 2.0 or later.' | 6 print 'Roundup requires python 2.0 or later.' |
| 7 sys.exit(1) | 7 sys.exit(1) |
| 142 backend = argv[n+1] | 142 backend = argv[n+1] |
| 143 else: | 143 else: |
| 144 template = backend = '' | 144 template = backend = '' |
| 145 while not instance_home: | 145 while not instance_home: |
| 146 instance_home = raw_input('Enter instance home: ').strip() | 146 instance_home = raw_input('Enter instance home: ').strip() |
| 147 # TODO: list the templates | 147 |
| 148 while not template: | 148 # select template |
| 149 template = raw_input('Select template: ').strip() | 149 import roundup.templates |
| 150 # TODO: list the backends | 150 templates = roundup.templates.listTemplates() |
| 151 while not backend: | 151 print 'Templates:', ', '.join(templates) |
| 152 backend = raw_input('Select backend: ').strip() | 152 template = '' |
| 153 while template not in templates: | |
| 154 template = raw_input('Select template [classic]: ').strip() | |
| 155 if not template: | |
| 156 template = 'classic' | |
| 157 | |
| 158 import roundup.backends | |
| 159 backends = roundup.backends.__all__ | |
| 160 backend = '' | |
| 161 while backend not in backends: | |
| 162 backend = raw_input('Select backend [anydbm]: ').strip() | |
| 163 if not backend: | |
| 164 backend = 'anydbm' | |
| 153 while adminpw != confirm: | 165 while adminpw != confirm: |
| 154 adminpw = getpass.getpass('Admin Password: ') | 166 adminpw = getpass.getpass('Admin Password: ') |
| 155 confirm = getpass.getpass(' Confirm: ') | 167 confirm = getpass.getpass(' Confirm: ') |
| 156 init.init(instance_home, template, backend, adminpw) | 168 init.init(instance_home, template, backend, adminpw) |
| 157 return 0 | 169 return 0 |
| 289 if __name__ == '__main__': | 301 if __name__ == '__main__': |
| 290 sys.exit(main()) | 302 sys.exit(main()) |
| 291 | 303 |
| 292 # | 304 # |
| 293 # $Log: not supported by cvs2svn $ | 305 # $Log: not supported by cvs2svn $ |
| 306 # Revision 1.4 2001/07/29 07:01:39 richard | |
| 307 # Added vim command to all source so that we don't get no steenkin' tabs :) | |
| 308 # | |
| 294 # Revision 1.3 2001/07/23 08:45:28 richard | 309 # Revision 1.3 2001/07/23 08:45:28 richard |
| 295 # ok, so now "./roundup-admin init" will ask questions in an attempt to get a | 310 # ok, so now "./roundup-admin init" will ask questions in an attempt to get a |
| 296 # workable instance_home set up :) | 311 # workable instance_home set up :) |
| 297 # _and_ anydbm has had its first test :) | 312 # _and_ anydbm has had its first test :) |
| 298 # | 313 # |
