From 8e58dd9d3b57b580c3b350f3291d40b80b5191b5 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Sun, 20 Oct 2024 19:19:53 +0200 Subject: [PATCH] fix(doc): correct typos --- src/zeroconf/_cache.py | 2 +- src/zeroconf/_core.py | 4 ++-- src/zeroconf/_handlers/query_handler.py | 4 ++-- src/zeroconf/_handlers/record_manager.py | 2 +- src/zeroconf/_listener.py | 2 +- src/zeroconf/_protocol/incoming.py | 2 +- src/zeroconf/_services/info.py | 2 +- src/zeroconf/_utils/time.py | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/zeroconf/_cache.py b/src/zeroconf/_cache.py index 333b6196..f34c4c16 100644 --- a/src/zeroconf/_cache.py +++ b/src/zeroconf/_cache.py @@ -172,7 +172,7 @@ def async_entries_with_server(self, name: str) -> Dict[DNSRecord, DNSRecord]: # The below functions are threadsafe and do not need to be run in the # event loop, however they all make copies so they significantly - # inefficent + # inefficient. def get(self, entry: DNSEntry) -> Optional[DNSRecord]: """Gets an entry by key. Will return None if there is no diff --git a/src/zeroconf/_core.py b/src/zeroconf/_core.py index b3ecd851..68cb8a9a 100644 --- a/src/zeroconf/_core.py +++ b/src/zeroconf/_core.py @@ -84,10 +84,10 @@ _UNREGISTER_TIME, ) -# The maximum amont of time to delay a multicast +# The maximum amount of time to delay a multicast # response in order to aggregate answers _AGGREGATION_DELAY = 500 # ms -# The maximum amont of time to delay a multicast +# The maximum amount of time to delay a multicast # response in order to aggregate answers after # it has already been delayed to protect the network # from excessive traffic. We use a shorter time diff --git a/src/zeroconf/_handlers/query_handler.py b/src/zeroconf/_handlers/query_handler.py index f2e11236..3acb1b44 100644 --- a/src/zeroconf/_handlers/query_handler.py +++ b/src/zeroconf/_handlers/query_handler.py @@ -441,7 +441,7 @@ def handle_assembled_query( ) -> None: """Respond to a (re)assembled query. - If the protocol recieved packets with the TC bit set, it will + If the protocol received packets with the TC bit set, it will wait a bit for the rest of the packets and only call handle_assembled_query once it has a complete set of packets or the timer expires. If the TC bit is not set, a single @@ -457,7 +457,7 @@ def handle_assembled_query( id_ = first_packet.id out = construct_outgoing_unicast_answers(question_answers.ucast, ucast_source, questions, id_) # When sending unicast, only send back the reply - # via the same socket that it was recieved from + # via the same socket that it was received from # as we know its reachable from that socket self.zc.async_send(out, addr, port, v6_flow_scope, transport) if question_answers.mcast_now: diff --git a/src/zeroconf/_handlers/record_manager.py b/src/zeroconf/_handlers/record_manager.py index 8ae82ba5..53ab3ed1 100644 --- a/src/zeroconf/_handlers/record_manager.py +++ b/src/zeroconf/_handlers/record_manager.py @@ -146,7 +146,7 @@ def async_updates_from_response(self, msg: DNSIncoming) -> None: # that any ServiceBrowser that is going to call # zc.get_service_info will see the cached value # but ONLY after all the record updates have been - # processsed. + # processed. new = False if other_adds or address_adds: new = cache.async_add_records(address_adds) diff --git a/src/zeroconf/_listener.py b/src/zeroconf/_listener.py index 19cca8df..4490965f 100644 --- a/src/zeroconf/_listener.py +++ b/src/zeroconf/_listener.py @@ -241,7 +241,7 @@ def _respond_query( def error_received(self, exc: Exception) -> None: """Likely socket closed or IPv6.""" # We preformat the message string with the socket as we want - # log_exception_once to log a warrning message once PER EACH + # log_exception_once to log a warning message once PER EACH # different socket in case there are problems with multiple # sockets msg_str = f"Error with socket {self.sock_description}): %s" diff --git a/src/zeroconf/_protocol/incoming.py b/src/zeroconf/_protocol/incoming.py index 8670b0df..f7b1d773 100644 --- a/src/zeroconf/_protocol/incoming.py +++ b/src/zeroconf/_protocol/incoming.py @@ -171,7 +171,7 @@ def num_additionals(self) -> int: return self._num_additionals def _initial_parse(self) -> None: - """Parse the data needed to initalize the packet object.""" + """Parse the data needed to initialize the packet object.""" self._read_header() self._read_questions() if not self._num_questions: diff --git a/src/zeroconf/_services/info.py b/src/zeroconf/_services/info.py index d18c8402..8a85ad10 100644 --- a/src/zeroconf/_services/info.py +++ b/src/zeroconf/_services/info.py @@ -221,7 +221,7 @@ def name(self) -> str: @name.setter def name(self, name: str) -> None: - """Replace the the name and reset the key.""" + """Replace the name and reset the key.""" self._name = name self.key = name.lower() self._dns_service_cache = None diff --git a/src/zeroconf/_utils/time.py b/src/zeroconf/_utils/time.py index 2ed8ca92..055e0658 100644 --- a/src/zeroconf/_utils/time.py +++ b/src/zeroconf/_utils/time.py @@ -28,7 +28,7 @@ def current_time_millis() -> _float: """Current time in milliseconds. - The current implemention uses `time.monotonic` + The current implementation uses `time.monotonic` but may change in the future. The design requires the time to match asyncio.loop.time()