mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-31 05:00:41 +00:00
20 lines
390 B
Python
20 lines
390 B
Python
|
|
# 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`
|