Using FS mtime to reload non recursive cache.
[pyTivo.git] / Cheetah / Utils / optik / errors.py
blob2ed75e6c775736f7c1aa52e182233f9705f9e41c
1 """optik.errors
3 Exception classes used by Optik.
4 """
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):
16 self.msg = msg
18 def __str__ (self):
19 return self.msg
22 class OptionError (OptikError):
23 """
24 Raised if an Option instance is created with invalid or
25 inconsistent arguments.
26 """
28 def __init__ (self, msg, option):
29 self.msg = msg
30 self.option_id = str(option)
32 def __str__ (self):
33 if self.option_id:
34 return "option %s: %s" % (self.option_id, self.msg)
35 else:
36 return self.msg
38 class OptionConflictError (OptionError):
39 """
40 Raised if conflicting options are added to an OptionParser.
41 """
43 class OptionValueError (OptikError):
44 """
45 Raised if an invalid option value is encountered on the command
46 line.
47 """
49 class BadOptionError (OptikError):
50 """
51 Raised if an invalid or ambiguous option is seen on the command-line.
52 """