| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,12 +79,6 @@ def __init__(self) -> None: | |||
| 79 | 79 | # be run in the event loop. | |
| 80 | 80 | ||
| 81 | 81 | 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 | - """ | ||
| 88 | 82 | # Previously storage of records was implemented as a list | |
| 89 | 83 | # instead a dict. Since DNSRecords are now hashable, the implementation | |
| 90 | 84 | # 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: | |||
| 163 | 157 | return new | |
| 164 | 158 | ||
| 165 | 159 | def _async_remove(self, record: _DNSRecord) -> None: | |
| 166 | - """Removes an entry. | ||
| 167 | - | ||
| 168 | - This function must be run in from event loop. | ||
| 169 | - """ | ||
| 170 | 160 | if isinstance(record, DNSService): | |
| 171 | 161 | service_record = record | |
| 172 | 162 | _remove_key(self.service_cache, service_record.server_key, service_record) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -563,12 +563,6 @@ def _add_broadcast_answer( # pylint: disable=no-self-use | |||
| 563 | 563 | out.add_answer_at_time(record, 0) | |
| 564 | 564 | ||
| 565 | 565 | 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 | - """ | ||
| 572 | 566 | assert self.loop is not None | |
| 573 | 567 | run_coro_with_timeout( | |
| 574 | 568 | self.async_unregister_service(info), | |
@@ -577,7 +571,6 @@ def unregister_service(self, info: ServiceInfo) -> None: | |||
| 577 | 571 | ) | |
| 578 | 572 | ||
| 579 | 573 | async def async_unregister_service(self, info: ServiceInfo) -> Awaitable: | |
| 580 | - """Unregister a service.""" | ||
| 581 | 574 | info.set_server_if_missing() | |
| 582 | 575 | self.registry.async_remove(info) | |
| 583 | 576 | # If another server uses the same addresses, we do not want to send | |
@@ -680,10 +673,6 @@ def add_listener( | |||
| 680 | 673 | self.loop.call_soon_threadsafe(self.record_manager.async_add_listener, listener, question) | |
| 681 | 674 | ||
| 682 | 675 | def remove_listener(self, listener: RecordUpdateListener) -> None: | |
| 683 | - """Removes a listener. | ||
| 684 | - | ||
| 685 | - This function is threadsafe | ||
| 686 | - """ | ||
| 687 | 676 | assert self.loop is not None | |
| 688 | 677 | self.loop.call_soon_threadsafe(self.record_manager.async_remove_listener, listener) | |
| 689 | 678 | ||
@@ -696,10 +685,6 @@ def async_add_listener( | |||
| 696 | 685 | self.record_manager.async_add_listener(listener, question) | |
| 697 | 686 | ||
| 698 | 687 | 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 | - """ | ||
| 703 | 688 | self.record_manager.async_remove_listener(listener) | |
| 704 | 689 | ||
| 705 | 690 | def send( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,8 +64,6 @@ class DNSQuestionType(enum.Enum): | |||
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | 66 | class DNSEntry: # noqa: PLW1641 | |
| 67 | - """A DNS entry""" | ||
| 68 | - | ||
| 69 | 67 | __slots__ = ("class_", "key", "name", "type", "unique") | |
| 70 | 68 | ||
| 71 | 69 | def __init__(self, name: str, type_: int, class_: int) -> None: | |
@@ -148,7 +146,6 @@ def unicast(self, value: bool) -> None: | |||
| 148 | 146 | self.unique = value | |
| 149 | 147 | ||
| 150 | 148 | def __repr__(self) -> str: | |
| 151 | - """String representation""" | ||
| 152 | 149 | return "{}[question,{},{},{}]".format( | |
| 153 | 150 | self.get_type(self.type), | |
| 154 | 151 | "QU" if self.unicast else "QM", | |
@@ -502,7 +499,6 @@ def __hash__(self) -> int: | |||
| 502 | 499 | return self._hash | |
| 503 | 500 | ||
| 504 | 501 | def __repr__(self) -> str: | |
| 505 | - """String representation""" | ||
| 506 | 502 | return self.to_string(f"{self.server}:{self.port}") | |
| 507 | 503 | ||
| 508 | 504 | ||
@@ -574,7 +570,6 @@ def __hash__(self) -> int: | |||
| 574 | 570 | return self._hash | |
| 575 | 571 | ||
| 576 | 572 | def __repr__(self) -> str: | |
| 577 | - """String representation""" | ||
| 578 | 573 | return self.to_string( | |
| 579 | 574 | self.next_name + "," + "|".join([self.get_type(type_) for type_ in self.rdtypes]) | |
| 580 | 575 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -195,10 +195,6 @@ def _async_update_matching_records( | |||
| 195 | 195 | self.zc.async_notify_all() | |
| 196 | 196 | ||
| 197 | 197 | 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 | - """ | ||
| 202 | 198 | try: | |
| 203 | 199 | self.listeners.remove(listener) | |
| 204 | 200 | self.zc.async_notify_all() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -403,13 +403,6 @@ def _has_more_to_add( | |||
| 403 | 403 | ) | |
| 404 | 404 | ||
| 405 | 405 | 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).""" | ||
| 413 | 406 | packets_data = self.packets_data | |
| 414 | 407 | ||
| 415 | 408 | if self.state == STATE_FINISHED: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -474,7 +474,6 @@ def _unpack_text_into_properties(self) -> None: | |||
| 474 | 474 | self._properties = properties | |
| 475 | 475 | ||
| 476 | 476 | def get_name(self) -> str: | |
| 477 | - """Name accessor""" | ||
| 478 | 477 | return self._name[: len(self._name) - len(self.type) - 1] | |
| 479 | 478 | ||
| 480 | 479 | def _get_ip_addresses_from_cache_lifo( | |
@@ -1086,7 +1085,6 @@ def _generate_request_query( | |||
| 1086 | 1085 | return out | |
| 1087 | 1086 | ||
| 1088 | 1087 | def __repr__(self) -> str: | |
| 1089 | - """String representation""" | ||
| 1090 | 1088 | return "{}({})".format( | |
| 1091 | 1089 | type(self).__name__, | |
| 1092 | 1090 | ", ".join( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -179,11 +179,6 @@ async def async_unregister_all_services(self) -> None: | |||
| 179 | 179 | await self.zeroconf.async_unregister_all_services() | |
| 180 | 180 | ||
| 181 | 181 | 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 | - """ | ||
| 187 | 182 | return await self.zeroconf.async_unregister_service(info) | |
| 188 | 183 | ||
| 189 | 184 | async def async_update_service(self, info: ServiceInfo) -> Awaitable: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,8 +25,6 @@ | |||
| 25 | 25 | import re | |
| 26 | 26 | import socket | |
| 27 | 27 | ||
| 28 | - # Some timing constants | ||
| 29 | - | ||
| 30 | 28 | _UNREGISTER_TIME = 125 # ms | |
| 31 | 29 | _CHECK_TIME = 500 # ms | |
| 32 | 30 | _REGISTER_TIME = 225 # ms | |
@@ -51,7 +49,6 @@ | |||
| 51 | 49 | # a buffer timeout to ensure a coroutine can finish before | |
| 52 | 50 | # the future times out | |
| 53 | 51 | ||
| 54 | - # Some DNS constants | ||
| 55 | 52 | ||
| 56 | 53 | _MDNS_ADDR = "224.0.0.251" | |
| 57 | 54 | _MDNS_ADDR6 = "ff02::fb" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments