@@ -58,24 +58,6 @@ def __eq__(self, other: Any) -> bool:
5858 """Equal when key, type and class match."""
5959 return isinstance (other , DNSEntry ) and self ._dns_entry_matches (other )
6060
61- def entry_to_string (self , hdr : str , other : bytes | str | None ) -> str :
62- return "{}[{},{}{},{}]{}" .format (
63- hdr ,
64- self .get_type (self .type ),
65- self .get_class_ (self .class_ ),
66- "-unique" if self .unique else "" ,
67- self .name ,
68- f"={ cast (Any , other )} " if other is not None else "" ,
69- )
70-
71- @staticmethod
72- def get_class_ (class_ : int ) -> str :
73- return _CLASSES .get (class_ , f"?({ class_ } )" )
74-
75- @staticmethod
76- def get_type (t : int ) -> str :
77- return _TYPES .get (t , f"?({ t } )" )
78-
7961 def _dns_entry_matches (self , other : DNSEntry ) -> bool :
8062 return self .key == other .key and self .type == other .type and self .class_ == other .class_
8163
@@ -190,10 +172,6 @@ def suppressed_by(self, msg: DNSIncoming) -> bool:
190172 return True
191173 return False
192174
193- def to_string (self , other : bytes | str ) -> str :
194- arg = f"{ self .ttl } /{ int (self .get_remaining_ttl (current_time_millis ()))} ,{ cast (Any , other )} "
195- return DNSEntry .entry_to_string (self , "record" , arg )
196-
197175 def write (self , out : DNSOutgoing ) -> None :
198176 raise AbstractMethodException (f"{ type (self ).__name__ } is missing write" )
199177
@@ -303,9 +281,6 @@ def __hash__(self) -> int:
303281 """Hash to compare like DNSHinfo."""
304282 return self ._hash
305283
306- def __repr__ (self ) -> str :
307- return self .to_string (self .cpu + " " + self .os )
308-
309284 def write (self , out : DNSOutgoing ) -> None :
310285 """Write the rdata to an outgoing packet."""
311286 out .write_character_string (self .cpu .encode ("utf-8" ))
@@ -478,9 +453,6 @@ def __hash__(self) -> int:
478453 """Hash to compare like DNSService."""
479454 return self ._hash
480455
481- def __repr__ (self ) -> str :
482- return self .to_string (f"{ self .server } :{ self .port } " )
483-
484456 def write (self , out : DNSOutgoing ) -> None :
485457 out .write_short (self .priority )
486458 out .write_short (self .weight )
0 commit comments