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

Method to_text

dns/node.py:93–111  ·  view source on GitHub ↗

Convert a node to text format. Each rdataset at the node is printed. Any keyword arguments to this method are passed on to the rdataset's to_text() method. *name*, a ``dns.name.Name``, the owner name of the rdatasets. Returns a ``str``.

(self, name: dns.name.Name, **kw: Dict[str, Any])

Source from the content-addressed store, hash-verified

91 self.rdatasets = []
92
93 def to_text(self, name: dns.name.Name, **kw: Dict[str, Any]) -> str:
94 """Convert a node to text format.
95
96 Each rdataset at the node is printed. Any keyword arguments
97 to this method are passed on to the rdataset's to_text() method.
98
99 *name*, a ``dns.name.Name``, the owner name of the
100 rdatasets.
101
102 Returns a ``str``.
103
104 """
105
106 s = io.StringIO()
107 for rds in self.rdatasets:
108 if len(rds) > 0:
109 s.write(rds.to_text(name, **kw)) # type: ignore[arg-type]
110 s.write("\n")
111 return s.getvalue()[:-1]
112
113 def __repr__(self):
114 return "<DNS node " + str(id(self)) + ">"

Callers 15

to_textFunction · 0.45
to_textFunction · 0.45
__init__Method · 0.45
to_textFunction · 0.45
algorithm_to_textFunction · 0.45
query_resultMethod · 0.45
_getaddrinfoFunction · 0.45
_getnameinfoFunction · 0.45
to_textFunction · 0.45
to_textFunction · 0.45
make_ssl_socketFunction · 0.45

Calls 1

writeMethod · 0.45

Tested by 15

test_zone_basicFunction · 0.36
_dumpFunction · 0.36
do_test_sign_zoneMethod · 0.36
_rdata_sortFunction · 0.36
testToTextMethod · 0.36
testFromTextMethod · 0.36
test_to_textMethod · 0.36
test_old_to_textMethod · 0.36
test_from_and_to_textMethod · 0.36