comparison roundup/admin.py @ 751:92abd71ec19b

out by one in the init args
author Richard Jones <richard@users.sourceforge.net>
date Sun, 26 May 2002 09:04:42 +0000
parents 7e093cbaaa98
children eea38c039e90
comparison
equal deleted inserted replaced
750:d7fe849a7bac 751:92abd71ec19b
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 # 18 #
19 # $Id: admin.py,v 1.11 2002-05-23 01:14:20 richard Exp $ 19 # $Id: admin.py,v 1.12 2002-05-26 09:04:42 richard Exp $
20 20
21 import sys, os, getpass, getopt, re, UserDict, shlex, shutil 21 import sys, os, getpass, getopt, re, UserDict, shlex, shutil
22 try: 22 try:
23 import csv 23 import csv
24 except ImportError: 24 except ImportError:
322 The administrator details will be set at this step. 322 The administrator details will be set at this step.
323 323
324 Execute the instance's initialisation function dbinit.init() 324 Execute the instance's initialisation function dbinit.init()
325 ''' 325 '''
326 # password 326 # password
327 if len(args) > 0: 327 print args
328 adminpw = args[0] 328 if len(args) > 1:
329 adminpw = args[1]
329 else: 330 else:
330 adminpw = '' 331 adminpw = ''
331 confirm = 'x' 332 confirm = 'x'
332 while adminpw != confirm: 333 while adminpw != confirm:
333 adminpw = getpass.getpass(_('Admin Password: ')) 334 adminpw = getpass.getpass(_('Admin Password: '))
334 confirm = getpass.getpass(_(' Confirm: ')) 335 confirm = getpass.getpass(_(' Confirm: '))
335 336
336 # email 337 # email
337 if len(args) > 1: 338 if len(args) > 2:
338 adminemail = args[1] 339 adminemail = args[2]
339 else: 340 else:
340 adminemail = '' 341 adminemail = ''
341 while not adminemail: 342 while not adminemail:
342 adminemail = raw_input(_(' Admin Email: ')).strip() 343 adminemail = raw_input(_(' Admin Email: ')).strip()
343 344
492 try: 493 try:
493 props[propname] = link_class.lookup(value) 494 props[propname] = link_class.lookup(value)
494 except TypeError: 495 except TypeError:
495 raise UsageError, _('%(classname)s has no key property"')%{ 496 raise UsageError, _('%(classname)s has no key property"')%{
496 'classname': link_class.classname} 497 'classname': link_class.classname}
497 except KeyError:
498 raise UsageError, _('%(classname)s has no entry "%(propname)s"')%{
499 'classname': link_class.classname, 'propname': propname}
500 498
501 # now do the find 499 # now do the find
502 try: 500 try:
503 if self.comma_sep: 501 if self.comma_sep:
504 print ','.join(apply(cl.find, (), props)) 502 print ','.join(apply(cl.find, (), props))
1122 tool = AdminTool() 1120 tool = AdminTool()
1123 sys.exit(tool.main()) 1121 sys.exit(tool.main())
1124 1122
1125 # 1123 #
1126 # $Log: not supported by cvs2svn $ 1124 # $Log: not supported by cvs2svn $
1125 # Revision 1.11 2002/05/23 01:14:20 richard
1126 # . split instance initialisation into two steps, allowing config changes
1127 # before the database is initialised.
1128 #
1127 # Revision 1.10 2002/04/27 10:07:23 richard 1129 # Revision 1.10 2002/04/27 10:07:23 richard
1128 # minor fix to error message 1130 # minor fix to error message
1129 # 1131 #
1130 # Revision 1.9 2002/03/12 22:51:47 richard 1132 # Revision 1.9 2002/03/12 22:51:47 richard
1131 # . #527416 ] roundup-admin uses undefined value 1133 # . #527416 ] roundup-admin uses undefined value

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