move drlaunch in drlaunch
[drlaunch] / drlaunch / src / xdg / Exceptions.py
1 """
2 Exception Classes for the xdg package
3 """
4
5 debug = False
6
7 class Error(Exception):
8     def __init__(self, msg):
9         self.msg = msg
10         Exception.__init__(self, msg)
11     def __str__(self):
12         return self.msg
13
14 class ValidationError(Error):
15     def __init__(self, msg, file):
16         self.msg = msg
17         self.file = file
18         Error.__init__(self, "ValidationError in file '%s': %s " % (file, msg))
19
20 class ParsingError(Error):
21     def __init__(self, msg, file):
22         self.msg = msg
23         self.file = file
24         Error.__init__(self, "ParsingError in file '%s', %s" % (file, msg))
25
26 class NoKeyError(Error):
27     def __init__(self, key, group, file):
28         Error.__init__(self, "No key '%s' in group %s of file %s" % (key, group, file))
29         self.key = key
30         self.group = group
31
32 class DuplicateKeyError(Error):
33     def __init__(self, key, group, file):
34         Error.__init__(self, "Duplicate key '%s' in group %s of file %s" % (key, group, file))
35         self.key = key
36         self.group = group
37
38 class NoGroupError(Error):
39     def __init__(self, group, file):
40         Error.__init__(self, "No group: %s in file %s" % (group, file))
41         self.group = group
42
43 class DuplicateGroupError(Error):
44     def __init__(self, group, file):
45         Error.__init__(self, "Duplicate group: %s in file %s" % (group, file))
46         self.group = group
47
48 class NoThemeError(Error):
49     def __init__(self, theme):
50         Error.__init__(self, "No such icon-theme: %s" % theme)
51         self.theme = theme