Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 49 lines (40 sloc) 1.068 kb
df02500 @richo initial import
richo authored
1 class Mapping(dict):
2 def __getitem__(self, item):
3 try:
4 return super(Mapping, self).__getitem__(item)
5 except KeyError:
6 self[item] = []
7 return self[item]
8
9 class LowerList(list):
10 @staticmethod
11 def lower(n):
12 try:
13 return n.lower()
14 except AttributeError:
15 return n
16 def __contains__(self, value):
17 return self.lower(value) in map(self.lower, self)
8661ae0 @richo Move all exceptions into lib (prelude to catching config)
richo authored
18
19 # Put all exceptions in lib.py
20
21 class ModuleError(Exception):
22 pass
23
24 class IrcDisconnected(Exception):
25 pass
26
27 class IrcTerminated(Exception):
28 pass
29 class FlushQueue(Exception):
30 """ Flush the event queue, don't wait for IO"""
31 pass
32 class ModulesDidntLoadDueToSyntax(Exception):
33 def __nonzero__(self):
34 # This allows us to retain the logical "if status" test.
35 return False
36
37 class Restart(Exception):
38 pass
39 class StopHandling(Exception):
40 pass
41
8953d70 @richo Move more exceptions
richo authored
42 class ModuleAlreadyLoaded(Exception):
43 pass
44
365e885 @richo Move more exceptions into lib, catch config errors
richo authored
45 class InvalidConfig(Exception):
46 pass
47 class NoConfigFile(Exception):
48 pass
Something went wrong with that request. Please try again.