Initial import to Tizen
[profile/ivi/python-twisted.git] / twisted / words / im / locals.py
1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4
5 class Enum:
6     group = None
7
8     def __init__(self, label):
9         self.label = label
10
11     def __repr__(self):
12         return '<%s: %s>' % (self.group, self.label)
13
14     def __str__(self):
15         return self.label
16
17
18 class StatusEnum(Enum):
19     group = 'Status'
20
21 OFFLINE = Enum('Offline')
22 ONLINE = Enum('Online')
23 AWAY = Enum('Away')
24
25 class OfflineError(Exception):
26     """The requested action can't happen while offline."""