Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 5c1b22b093f6adf6113b0063a543988e2e28c005 authored by cvs2svn on 10 January 2002, 16:25:57 UTC
This commit was manufactured by cvs2svn to create tag 'r212c1'.
Tip revision: 5c1b22b
dnsopcode.py
# Opcode values in message header (section 4.1.1)

QUERY = 0
IQUERY = 1
STATUS = 2

# Construct reverse mapping dictionary

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

def opcodestr(opcode):
	if opcodemap.has_key(opcode): return opcodemap[opcode]
	else: return `opcode`
back to top