MCPcopy Create free account
hub / github.com/rthalley/dnspython / to_text

Function to_text

dns/rcode.py:129–141  ·  view source on GitHub ↗

Convert rcode into text. *value*, a ``dns.rcode.Rcode``, the rcode. Raises ``ValueError`` if rcode is < 0 or > 4095. Returns a ``str``.

(value: Rcode, tsig: bool = False)

Source from the content-addressed store, hash-verified

127
128
129def to_text(value: Rcode, tsig: bool = False) -> str:
130 """Convert rcode into text.
131
132 *value*, a ``dns.rcode.Rcode``, the rcode.
133
134 Raises ``ValueError`` if rcode is < 0 or > 4095.
135
136 Returns a ``str``.
137 """
138
139 if tsig and value == Rcode.BADVERS:
140 return "BADSIG"
141 return Rcode.to_text(value)
142
143
144### BEGIN generated Rcode constants

Callers

nothing calls this directly

Calls 1

to_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…