Skip to content

Commit c362c9e

Browse files
committed
revert: remove prose found by the fuzzy paraphrase audit
1 parent 4339329 commit c362c9e

7 files changed

Lines changed: 0 additions & 75 deletions

File tree

‎src/zeroconf/_core.py‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -602,12 +602,6 @@ def generate_unregister_all_services(self) -> DNSOutgoing | None:
602602
return out
603603

604604
async def async_unregister_all_services(self) -> None:
605-
"""Unregister all registered services.
606-
607-
Unlike async_register_service and async_unregister_service, this
608-
method does not return a future and is always expected to be
609-
awaited since its only called at shutdown.
610-
"""
611605
# Send Goodbye packets https://datatracker.ietf.org/doc/html/rfc6762#section-10.1
612606
out = self.generate_unregister_all_services()
613607
if not out:
@@ -618,12 +612,6 @@ async def async_unregister_all_services(self) -> None:
618612
self.async_send(out)
619613

620614
def unregister_all_services(self) -> None:
621-
"""Unregister all registered services.
622-
623-
While it is not expected during normal operation,
624-
this function may raise EventLoopBlocked if the underlying
625-
call to `async_unregister_all_services` cannot be completed.
626-
"""
627615
assert self.loop is not None
628616
run_coro_with_timeout(
629617
self.async_unregister_all_services(),
@@ -712,7 +700,6 @@ def send(
712700
v6_flow_scope: tuple[()] | tuple[int, int] = (),
713701
transport: _WrappedTransport | None = None,
714702
) -> None:
715-
"""Sends an outgoing packet threadsafe."""
716703
assert self.loop is not None
717704
self.loop.call_soon_threadsafe(self.async_send, out, addr, port, v6_flow_scope, transport)
718705

@@ -724,7 +711,6 @@ def async_send(
724711
v6_flow_scope: tuple[()] | tuple[int, int] = (),
725712
transport: _WrappedTransport | None = None,
726713
) -> None:
727-
"""Sends an outgoing packet."""
728714
if self.done:
729715
return
730716

‎src/zeroconf/_dns.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def _dns_entry_matches(self, other: DNSEntry) -> bool:
8383
return self.key == other.key and self.type == other.type and self.class_ == other.class_
8484

8585
def __eq__(self, other: Any) -> bool:
86-
"""Equality test on key (lowercase name), type, and class"""
8786
return isinstance(other, DNSEntry) and self._dns_entry_matches(other)
8887

8988
@staticmethod
@@ -125,7 +124,6 @@ def __hash__(self) -> int:
125124
return self._hash
126125

127126
def __eq__(self, other: Any) -> bool:
128-
"""Tests equality on dns question."""
129127
return isinstance(other, DNSQuestion) and self._dns_entry_matches(other)
130128

131129
@property
@@ -379,11 +377,9 @@ def write(self, out: DNSOutgoing) -> None:
379377
out.write_name(self.alias)
380378

381379
def __eq__(self, other: Any) -> bool:
382-
"""Tests equality on alias."""
383380
return isinstance(other, DNSPointer) and self._eq(other)
384381

385382
def _eq(self, other: DNSPointer) -> bool:
386-
"""Tests equality on alias."""
387383
return self.alias_key == other.alias_key and self._dns_entry_matches(other)
388384

389385
def __hash__(self) -> int:
@@ -425,11 +421,9 @@ def __hash__(self) -> int:
425421
return self._hash
426422

427423
def __eq__(self, other: Any) -> bool:
428-
"""Tests equality on text."""
429424
return isinstance(other, DNSText) and self._eq(other)
430425

431426
def _eq(self, other: DNSText) -> bool:
432-
"""Tests equality on text."""
433427
return self.text == other.text and self._dns_entry_matches(other)
434428

435429
def __repr__(self) -> str:
@@ -508,8 +502,6 @@ def __repr__(self) -> str:
508502

509503

510504
class DNSNsec(DNSRecord):
511-
"""A DNS NSEC record"""
512-
513505
__slots__ = ("_hash", "next_name", "rdtypes")
514506

515507
def __init__(
@@ -560,11 +552,9 @@ def write(self, out: DNSOutgoing) -> None:
560552
out.write_string(out_bytes)
561553

562554
def __eq__(self, other: Any) -> bool:
563-
"""Tests equality on next_name and rdtypes."""
564555
return isinstance(other, DNSNsec) and self._eq(other)
565556

566557
def _eq(self, other: DNSNsec) -> bool:
567-
"""Tests equality on next_name and rdtypes."""
568558
return (
569559
self.next_name == other.next_name
570560
and self.rdtypes == other.rdtypes

‎src/zeroconf/_protocol/incoming.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,6 @@ def _read_record(
447447
return None
448448

449449
def _read_bitmap(self, end: _int) -> list[int]:
450-
"""Reads an NSEC bitmap from the packet."""
451450
rdtypes = []
452451
if end > self._data_len:
453452
raise IncomingDecodeError(

‎src/zeroconf/_protocol/outgoing.py‎

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -162,41 +162,6 @@ def add_authorative_answer(self, record: DNSPointer) -> None:
162162
self.authorities.append(record)
163163

164164
def add_additional_answer(self, record: DNSRecord) -> None:
165-
"""Adds an additional answer
166-
167-
From: RFC 6763, DNS-Based Service Discovery, February 2013
168-
169-
12. DNS Additional Record Generation
170-
171-
DNS has an efficiency feature whereby a DNS server may place
172-
additional records in the additional section of the DNS message.
173-
These additional records are records that the client did not
174-
explicitly request, but the server has reasonable grounds to expect
175-
that the client might request them shortly, so including them can
176-
save the client from having to issue additional queries.
177-
178-
This section recommends which additional records SHOULD be generated
179-
to improve network efficiency, for both Unicast and Multicast DNS-SD
180-
responses.
181-
182-
12.1. PTR Records
183-
184-
When including a DNS-SD Service Instance Enumeration or Selective
185-
Instance Enumeration (subtype) PTR record in a response packet, the
186-
server/responder SHOULD include the following additional records:
187-
188-
o The SRV record(s) named in the PTR rdata.
189-
o The TXT record(s) named in the PTR rdata.
190-
o All address records (type "A" and "AAAA") named in the SRV rdata.
191-
192-
12.2. SRV Records
193-
194-
When including an SRV record in a response packet, the
195-
server/responder SHOULD include the following additional records:
196-
197-
o All address records (type "A" and "AAAA") named in the SRV rdata.
198-
199-
"""
200165
self.additionals.append(record)
201166

202167
def _write_byte(self, value: int_) -> None:

‎src/zeroconf/_utils/name.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def service_type_name(type_: str, *, strict: bool = True) -> str: # pylint: dis
4141
"""
4242
Validate a fully qualified service name, instance or subtype. [rfc6763]
4343
44-
Returns fully qualified service name.
45-
4644
Domain names used by mDNS-SD take the following forms:
4745
4846
<sn> . <_tcp|_udp> . local.

‎src/zeroconf/_utils/time.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@
2828

2929

3030
def current_time_millis() -> _float:
31-
"""Current time in milliseconds.
32-
33-
The current implementation uses `time.monotonic`
34-
but may change in the future.
35-
36-
The design requires the time to match asyncio.loop.time()
37-
"""
3831
return time.monotonic() * 1000
3932

4033

‎src/zeroconf/asyncio.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,6 @@ async def async_register_service(
171171
)
172172

173173
async def async_unregister_all_services(self) -> None:
174-
"""Unregister all registered services.
175-
176-
Unlike async_register_service and async_unregister_service, this
177-
method does not return a future and is always expected to be
178-
awaited since its only called at shutdown.
179-
"""
180174
await self.zeroconf.async_unregister_all_services()
181175

182176
async def async_unregister_service(self, info: ServiceInfo) -> Awaitable:

0 commit comments

Comments
 (0)