File: Status.py

package info (click to toggle)
python-dns 0.cvs%2B20020417-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 168 kB
  • ctags: 301
  • sloc: python: 1,339; makefile: 24; sh: 6
file content (45 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
 $Id: Status.py,v 1.5 2002/03/19 12:41:33 anthonybaxter Exp $

 This file is part of the pydns project.
 Homepage: http://pydns.sourceforge.net

 This code is covered by the standard Python License.

 Status values in message header
"""

NOERROR       = 0
FORMERR       = 1
SERVFAIL      = 2
NXDOMAIN      = 3
NOTIMP        = 4
REFUSED       = 5

# Construct reverse mapping dictionary

_names = dir()
statusmap = {}
for _name in _names:
    if _name[0] != '_': statusmap[eval(_name)] = _name

def statusstr(status):
    if statusmap.has_key(status): return statusmap[status]
    else: return `status`

#
# $Log: Status.py,v $
# Revision 1.5  2002/03/19 12:41:33  anthonybaxter
# tabnannied and reindented everything. 4 space indent, no tabs.
# yay.
#
# Revision 1.4  2002/03/19 12:26:13  anthonybaxter
# death to leading tabs.
#
# Revision 1.3  2001/08/09 09:08:55  anthonybaxter
# added identifying header to top of each file
#
# Revision 1.2  2001/07/19 06:57:07  anthony
# cvs keywords added
#
#