+def _fmt_path(path):
+ return ' -> '.join(["`%s'" % hop for hop in path])
+
+class AmbiguousOptionError (Exception):
+ def __init__(me, key, patha, vala, pathb, valb):
+ me.key = key
+ me.patha, me.vala = patha, vala
+ me.pathb, me.valb = pathb, valb
+ def __str__(me):
+ return "Ambiguous answer resolving key `%s': " \
+ "path %s yields `%s' but %s yields `%s'" % \
+ (me.key, _fmt_path(me.patha), me.vala, _fmt_path(me.pathb), me.valb)
+
+class InheritanceCycleError (Exception):
+ def __init__(me, key, path):
+ me.key = key
+ me.path = path
+ def __str__(me):
+ return "Found a cycle %s looking up key `%s'" % \
+ (_fmt_path(me.path), me.key)
+
+class MissingKeyException (Exception):
+ def __init__(me, sec, key):
+ me.sec = sec
+ me.key = key
+ def __str__(me):
+ return "Key `%s' not found in section `%s'" % (me.key, me.sec)
+