~landscape/zope3/newer-from-ztk

« back to all changes in this revision

Viewing changes to src/twisted/words/im/locals.py

  • Committer: Thomas Hervé
  • Date: 2009-07-08 13:52:04 UTC
  • Revision ID: thomas@canonical.com-20090708135204-df5eesrthifpylf8
Remove twisted copy

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."""