comparison roundup-admin @ 379:c7b5b1aa6b4a

More error handling fixes.
author Richard Jones <richard@users.sourceforge.net>
date Fri, 09 Nov 2001 22:33:28 +0000
parents 93dc08528ad9
children a1331423eb93
comparison
equal deleted inserted replaced
378:f3c8556fdeb8 379:c7b5b1aa6b4a
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: roundup-admin,v 1.42 2001-11-09 10:11:08 richard Exp $ 19 # $Id: roundup-admin,v 1.43 2001-11-09 22:33:28 richard Exp $
20 20
21 import sys 21 import sys
22 if int(sys.version[0]) < 2: 22 if int(sys.version[0]) < 2:
23 print 'Roundup requires python 2.0 or later.' 23 print 'Roundup requires python 2.0 or later.'
24 sys.exit(1) 24 sys.exit(1)
285 for prop in args[1:]: 285 for prop in args[1:]:
286 if prop.find('=') == -1: 286 if prop.find('=') == -1:
287 raise UsageError, 'argument "%s" not propname=value'%prop 287 raise UsageError, 'argument "%s" not propname=value'%prop
288 try: 288 try:
289 key, value = prop.split('=') 289 key, value = prop.split('=')
290 except (TypeError, ValueError): 290 except ValueError:
291 raise UsageError, 'argument "%s" not propname=value'%prop 291 raise UsageError, 'argument "%s" not propname=value'%prop
292 props[key] = value 292 props[key] = value
293 for designator in designators: 293 for designator in designators:
294 # decode the node designator 294 # decode the node designator
295 try: 295 try:
350 # handle the propname=value argument 350 # handle the propname=value argument
351 if prop.find('=') == -1: 351 if prop.find('=') == -1:
352 raise UsageError, 'argument "%s" not propname=value'%prop 352 raise UsageError, 'argument "%s" not propname=value'%prop
353 try: 353 try:
354 propname, value = args[1].split('=') 354 propname, value = args[1].split('=')
355 except (TypeError, ValueError): 355 except ValueError:
356 raise UsageError, 'argument "%s" not propname=value'%prop 356 raise UsageError, 'argument "%s" not propname=value'%prop
357 357
358 # if the value isn't a number, look up the linked class to get the 358 # if the value isn't a number, look up the linked class to get the
359 # number 359 # number
360 num_re = re.compile('^\d+$') 360 num_re = re.compile('^\d+$')
458 for prop in args[1:]: 458 for prop in args[1:]:
459 if prop.find('=') == -1: 459 if prop.find('=') == -1:
460 raise UsageError, 'argument "%s" not propname=value'%prop 460 raise UsageError, 'argument "%s" not propname=value'%prop
461 try: 461 try:
462 key, value = prop.split('=') 462 key, value = prop.split('=')
463 except (TypeError, ValueError): 463 except ValueError:
464 raise UsageError, 'argument "%s" not propname=value'%prop 464 raise UsageError, 'argument "%s" not propname=value'%prop
465 props[key] = value 465 props[key] = value
466 466
467 # convert types 467 # convert types
468 for key in props.keys(): 468 for key in props.keys():
880 tool = AdminTool() 880 tool = AdminTool()
881 sys.exit(tool.main()) 881 sys.exit(tool.main())
882 882
883 # 883 #
884 # $Log: not supported by cvs2svn $ 884 # $Log: not supported by cvs2svn $
885 # Revision 1.42 2001/11/09 10:11:08 richard
886 # . roundup-admin now handles all hyperdb exceptions
887 #
885 # Revision 1.41 2001/11/09 01:25:40 richard 888 # Revision 1.41 2001/11/09 01:25:40 richard
886 # Should parse with python 1.5.2 now. 889 # Should parse with python 1.5.2 now.
887 # 890 #
888 # Revision 1.40 2001/11/08 04:42:00 richard 891 # Revision 1.40 2001/11/08 04:42:00 richard
889 # Expanded the already-abbreviated "initialise" and "specification" commands, 892 # Expanded the already-abbreviated "initialise" and "specification" commands,

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