~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-17 14:52:35 UTC
  • mfrom: (1.1.5 upstream) (2.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20070117145235-btmig6qfmqfen0om
Tags: 2.5.0-0ubuntu1
New upstream version, compatible with python2.5.

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