1616# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818#
19- # $Id: roundup-admin,v 1.21 2001-10-05 02:23:24 richard Exp $
19+ # $Id: roundup-admin,v 1.22 2001-10-09 07:25:59 richard Exp $
2020
2121import sys
2222if int (sys .version [0 ]) < 2 :
2323 print 'Roundup requires python 2.0 or later.'
2424 sys .exit (1 )
2525
2626import string , os , getpass , getopt , re
27- from roundup import date , roundupdb , init
27+ from roundup import date , roundupdb , init , password
2828import roundup .instance
2929
3030def usage (message = '' ):
@@ -180,6 +180,8 @@ def do_set(db, args):
180180 type = properties [key ]
181181 if isinstance (type , hyperdb .String ):
182182 continue
183+ elif isinstance (type , hyperdb .Password ):
184+ props [key ] = password .Password (value )
183185 elif isinstance (type , hyperdb .Date ):
184186 props [key ] = date .Date (value )
185187 elif isinstance (type , hyperdb .Interval ):
@@ -379,11 +381,6 @@ def main():
379381 return 0
380382 if opt == '-i' :
381383 instance_home = arg
382- if opt == '-u' :
383- l = arg .split (':' )
384- name = l [0 ]
385- if len (l ) > 1 :
386- password = l [1 ]
387384 if opt == '-c' :
388385 comma_sep = 1
389386
@@ -418,24 +415,18 @@ def main():
418415 if command == 'init' :
419416 return do_init (instance_home , args )
420417
421- # open the database
422- if command in ('create' , 'set' , 'retire' , 'freshen' ):
423- while not name :
424- name = raw_input ('Login name: ' )
425- while not password :
426- password = getpass .getpass (' password: ' )
427-
428- # get the instance
429- instance = roundup .instance .open (instance_home )
430-
431418 function = figureCommands ().get (command , None )
432419
433420 # not a valid command
434421 if function is None :
435422 usage ('Unknown command "%s"' % command )
436423 return 1
437424
438- db = instance .open (name or 'admin' )
425+ # get the instance
426+ instance = roundup .instance .open (instance_home )
427+ db = instance .open ('admin' )
428+
429+ # do the command
439430 try :
440431 return function (db , args [1 :])
441432 finally :
@@ -449,6 +440,26 @@ if __name__ == '__main__':
449440
450441#
451442# $Log: not supported by cvs2svn $
443+ # Revision 1.21 2001/10/05 02:23:24 richard
444+ # . roundup-admin create now prompts for property info if none is supplied
445+ # on the command-line.
446+ # . hyperdb Class getprops() method may now return only the mutable
447+ # properties.
448+ # . Login now uses cookies, which makes it a whole lot more flexible. We can
449+ # now support anonymous user access (read-only, unless there's an
450+ # "anonymous" user, in which case write access is permitted). Login
451+ # handling has been moved into cgi_client.Client.main()
452+ # . The "extended" schema is now the default in roundup init.
453+ # . The schemas have had their page headings modified to cope with the new
454+ # login handling. Existing installations should copy the interfaces.py
455+ # file from the roundup lib directory to their instance home.
456+ # . Incorrectly had a Bizar Software copyright on the cgitb.py module from
457+ # Ping - has been removed.
458+ # . Fixed a whole bunch of places in the CGI interface where we should have
459+ # been returning Not Found instead of throwing an exception.
460+ # . Fixed a deviation from the spec: trying to modify the 'id' property of
461+ # an item now throws an exception.
462+ #
452463# Revision 1.20 2001/10/04 02:12:42 richard
453464# Added nicer command-line item adding: passing no arguments will enter an
454465# interactive more which asks for each property in turn. While I was at it, I
0 commit comments