3 Exception classes used by Optik.
6 __revision__
= "$Id: errors.py,v 1.1 2002/08/24 17:10:06 hierro Exp $"
8 # Copyright (c) 2001 Gregory P. Ward. All rights reserved.
9 # See the README.txt distributed with Optik for licensing terms.
11 # created 2001/10/17 GPW (from optik.py)
14 class OptikError (Exception):
15 def __init__ (self
, msg
):
22 class OptionError (OptikError
):
24 Raised if an Option instance is created with invalid or
25 inconsistent arguments.
28 def __init__ (self
, msg
, option
):
30 self
.option_id
= str(option
)
34 return "option %s: %s" % (self
.option_id
, self
.msg
)
38 class OptionConflictError (OptionError
):
40 Raised if conflicting options are added to an OptionParser.
43 class OptionValueError (OptikError
):
45 Raised if an invalid option value is encountered on the command
49 class BadOptionError (OptikError
):
51 Raised if an invalid or ambiguous option is seen on the command-line.