aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/words/im/locals.py
blob: a63547a3036dab08a36e8ce86e8cbddb31df8575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.


class Enum:
    group = None

    def __init__(self, label):
        self.label = label

    def __repr__(self):
        return '<%s: %s>' % (self.group, self.label)

    def __str__(self):
        return self.label


class StatusEnum(Enum):
    group = 'Status'

OFFLINE = Enum('Offline')
ONLINE = Enum('Online')
AWAY = Enum('Away')

class OfflineError(Exception):
    """The requested action can't happen while offline."""