Staging
v0.8.1
https://github.com/python/cpython
Raw File
Tip revision: 8c83ec63f59b5a9512f907aa4f2c63d3ed7af7a0 authored by cvs2svn on 16 April 2001, 02:07:08 UTC
This commit was manufactured by cvs2svn to create tag 'r21c2'.
Tip revision: 8c83ec6
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