Mercurial > p > roundup > code
diff roundup-admin @ 380:a1331423eb93
Fixed issues with nosy reaction and author copies.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 12 Nov 2001 22:01:07 +0000 |
| parents | c7b5b1aa6b4a |
| children | 59ed29a879f6 |
line wrap: on
line diff
--- a/roundup-admin Fri Nov 09 22:33:28 2001 +0000 +++ b/roundup-admin Mon Nov 12 22:01:07 2001 +0000 @@ -16,7 +16,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup-admin,v 1.43 2001-11-09 22:33:28 richard Exp $ +# $Id: roundup-admin,v 1.44 2001-11-12 22:01:06 richard Exp $ import sys if int(sys.version[0]) < 2: @@ -64,6 +64,7 @@ for k in AdminTool.__dict__.keys(): if k[:5] == 'help_': self.help[k[5:]] = getattr(self, k) + self.db = None def usage(message=''): if message: message = 'Problem: '+message+'\n' @@ -799,11 +800,15 @@ self.instance_home = raw_input('Enter instance home: ').strip() # before we open the db, we may be doing an init - if command == 'init': - return self.do_init(self.instance_home, args) + if command == 'initialise': + return self.do_initialise(self.instance_home, args) # get the instance - instance = roundup.instance.open(self.instance_home) + try: + instance = roundup.instance.open(self.instance_home) + except ValueError, message: + print "Couldn't open instance: %s"%message + return 1 self.db = instance.open('admin') if len(args) < 2: @@ -872,7 +877,8 @@ self.interactive() else: ret = self.run_command(args) - self.db.close() + if self.db: + self.db.close() return ret @@ -882,6 +888,9 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.43 2001/11/09 22:33:28 richard +# More error handling fixes. +# # Revision 1.42 2001/11/09 10:11:08 richard # . roundup-admin now handles all hyperdb exceptions #
