FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

revert: remove short verbatim prose caught by the whole unit audit · python-zeroconf/python-zeroconf@d87d82e · GitHub

Repository navigation

Commit d87d82e

Browse files
committed
revert: remove short verbatim prose caught by the whole unit audit
1 parent 5f6b926 commit d87d82e

8 files changed

Lines changed: 0 additions & 51 deletions

File tree

‎src/zeroconf/_cache.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ def __init__(self) -> None:
7979
# be run in the event loop.
8080

8181
def _async_add(self, record: _DNSRecord) -> bool:
82-
"""Adds an entry.
83-
84-
Returns true if the entry was not already in the cache.
85-
86-
This function must be run in from event loop.
87-
"""
8882
# Previously storage of records was implemented as a list
8983
# instead a dict. Since DNSRecords are now hashable, the implementation
9084
# uses a dict to ensure that adding a new record to the cache
@@ -163,10 +157,6 @@ def async_add_records(self, entries: Iterable[DNSRecord]) -> bool:
163157
return new
164158

165159
def _async_remove(self, record: _DNSRecord) -> None:
166-
"""Removes an entry.
167-
168-
This function must be run in from event loop.
169-
"""
170160
if isinstance(record, DNSService):
171161
service_record = record
172162
_remove_key(self.service_cache, service_record.server_key, service_record)

‎src/zeroconf/_core.py‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,6 @@ def _add_broadcast_answer( # pylint: disable=no-self-use
563563
out.add_answer_at_time(record, 0)
564564

565565
def unregister_service(self, info: ServiceInfo) -> None:
566-
"""Unregister a service.
567-
568-
While it is not expected during normal operation,
569-
this function may raise EventLoopBlocked if the underlying
570-
call to `async_unregister_service` cannot be completed.
571-
"""
572566
assert self.loop is not None
573567
run_coro_with_timeout(
574568
self.async_unregister_service(info),
@@ -577,7 +571,6 @@ def unregister_service(self, info: ServiceInfo) -> None:
577571
)
578572

579573
async def async_unregister_service(self, info: ServiceInfo) -> Awaitable:
580-
"""Unregister a service."""
581574
info.set_server_if_missing()
582575
self.registry.async_remove(info)
583576
# If another server uses the same addresses, we do not want to send
@@ -680,10 +673,6 @@ def add_listener(
680673
self.loop.call_soon_threadsafe(self.record_manager.async_add_listener, listener, question)
681674

682675
def remove_listener(self, listener: RecordUpdateListener) -> None:
683-
"""Removes a listener.
684-
685-
This function is threadsafe
686-
"""
687676
assert self.loop is not None
688677
self.loop.call_soon_threadsafe(self.record_manager.async_remove_listener, listener)
689678

@@ -696,10 +685,6 @@ def async_add_listener(
696685
self.record_manager.async_add_listener(listener, question)
697686

698687
def async_remove_listener(self, listener: RecordUpdateListener) -> None:
699-
"""Removes a listener.
700-
701-
This function is not threadsafe and must be called in the eventloop.
702-
"""
703688
self.record_manager.async_remove_listener(listener)
704689

705690
def send(

‎src/zeroconf/_dns.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ class DNSQuestionType(enum.Enum):
6464

6565

6666
class DNSEntry: # noqa: PLW1641
67-
"""A DNS entry"""
68-
6967
__slots__ = ("class_", "key", "name", "type", "unique")
7068

7169
def __init__(self, name: str, type_: int, class_: int) -> None:
@@ -148,7 +146,6 @@ def unicast(self, value: bool) -> None:
148146
self.unique = value
149147

150148
def __repr__(self) -> str:
151-
"""String representation"""
152149
return "{}[question,{},{},{}]".format(
153150
self.get_type(self.type),
154151
"QU" if self.unicast else "QM",
@@ -502,7 +499,6 @@ def __hash__(self) -> int:
502499
return self._hash
503500

504501
def __repr__(self) -> str:
505-
"""String representation"""
506502
return self.to_string(f"{self.server}:{self.port}")
507503

508504

@@ -574,7 +570,6 @@ def __hash__(self) -> int:
574570
return self._hash
575571

576572
def __repr__(self) -> str:
577-
"""String representation"""
578573
return self.to_string(
579574
self.next_name + "," + "|".join([self.get_type(type_) for type_ in self.rdtypes])
580575
)

‎src/zeroconf/_handlers/record_manager.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ def _async_update_matching_records(
195195
self.zc.async_notify_all()
196196

197197
def async_remove_listener(self, listener: RecordUpdateListener) -> None:
198-
"""Removes a listener.
199-
200-
This function is not threadsafe and must be called in the eventloop.
201-
"""
202198
try:
203199
self.listeners.remove(listener)
204200
self.zc.async_notify_all()

‎src/zeroconf/_protocol/outgoing.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,6 @@ def _has_more_to_add(
403403
)
404404

405405
def packets(self) -> list[bytes]:
406-
"""Returns a list of bytestrings containing the packets' bytes
407-
408-
is done. The packets are each restricted to _MAX_MSG_TYPICAL
409-
or less in length, except for the case of a single answer which
410-
will be written out to a single oversized packet no more than
411-
_MAX_MSG_ABSOLUTE in length (and hence will be subject to IP
412-
fragmentation potentially)."""
413406
packets_data = self.packets_data
414407

415408
if self.state == STATE_FINISHED:

‎src/zeroconf/_services/info.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,6 @@ def _unpack_text_into_properties(self) -> None:
474474
self._properties = properties
475475

476476
def get_name(self) -> str:
477-
"""Name accessor"""
478477
return self._name[: len(self._name) - len(self.type) - 1]
479478

480479
def _get_ip_addresses_from_cache_lifo(
@@ -1086,7 +1085,6 @@ def _generate_request_query(
10861085
return out
10871086

10881087
def __repr__(self) -> str:
1089-
"""String representation"""
10901088
return "{}({})".format(
10911089
type(self).__name__,
10921090
", ".join(

‎src/zeroconf/asyncio.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,6 @@ async def async_unregister_all_services(self) -> None:
179179
await self.zeroconf.async_unregister_all_services()
180180

181181
async def async_unregister_service(self, info: ServiceInfo) -> Awaitable:
182-
"""Unregister a service.
183-
184-
The service will be broadcast in a task. This task is returned
185-
and therefore can be awaited if necessary.
186-
"""
187182
return await self.zeroconf.async_unregister_service(info)
188183

189184
async def async_update_service(self, info: ServiceInfo) -> Awaitable:

‎src/zeroconf/const.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import re
2626
import socket
2727

28-
# Some timing constants
29-
3028
_UNREGISTER_TIME = 125 # ms
3129
_CHECK_TIME = 500 # ms
3230
_REGISTER_TIME = 225 # ms
@@ -51,7 +49,6 @@
5149
# a buffer timeout to ensure a coroutine can finish before
5250
# the future times out
5351

54-
# Some DNS constants
5552

5653
_MDNS_ADDR = "224.0.0.251"
5754
_MDNS_ADDR6 = "ff02::fb"

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL