~midokura/nova/midostack-oneiric

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/twisted/words/im/locals.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2001-2004 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."""