| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -602,12 +602,6 @@ def generate_unregister_all_services(self) -> DNSOutgoing | None: | |||
| 602 | 602 | return out | |
| 603 | 603 | ||
| 604 | 604 | 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 | - """ | ||
| 611 | 605 | # Send Goodbye packets https://datatracker.ietf.org/doc/html/rfc6762#section-10.1 | |
| 612 | 606 | out = self.generate_unregister_all_services() | |
| 613 | 607 | if not out: | |
@@ -618,12 +612,6 @@ async def async_unregister_all_services(self) -> None: | |||
| 618 | 612 | self.async_send(out) | |
| 619 | 613 | ||
| 620 | 614 | 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 | - """ | ||
| 627 | 615 | assert self.loop is not None | |
| 628 | 616 | run_coro_with_timeout( | |
| 629 | 617 | self.async_unregister_all_services(), | |
@@ -712,7 +700,6 @@ def send( | |||
| 712 | 700 | v6_flow_scope: tuple[()] | tuple[int, int] = (), | |
| 713 | 701 | transport: _WrappedTransport | None = None, | |
| 714 | 702 | ) -> None: | |
| 715 | - """Sends an outgoing packet threadsafe.""" | ||
| 716 | 703 | assert self.loop is not None | |
| 717 | 704 | self.loop.call_soon_threadsafe(self.async_send, out, addr, port, v6_flow_scope, transport) | |
| 718 | 705 | ||
@@ -724,7 +711,6 @@ def async_send( | |||
| 724 | 711 | v6_flow_scope: tuple[()] | tuple[int, int] = (), | |
| 725 | 712 | transport: _WrappedTransport | None = None, | |
| 726 | 713 | ) -> None: | |
| 727 | - """Sends an outgoing packet.""" | ||
| 728 | 714 | if self.done: | |
| 729 | 715 | return | |
| 730 | 716 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,7 +83,6 @@ def _dns_entry_matches(self, other: DNSEntry) -> bool: | |||
| 83 | 83 | return self.key == other.key and self.type == other.type and self.class_ == other.class_ | |
| 84 | 84 | ||
| 85 | 85 | def __eq__(self, other: Any) -> bool: | |
| 86 | - """Equality test on key (lowercase name), type, and class""" | ||
| 87 | 86 | return isinstance(other, DNSEntry) and self._dns_entry_matches(other) | |
| 88 | 87 | ||
| 89 | 88 | @staticmethod | |
@@ -125,7 +124,6 @@ def __hash__(self) -> int: | |||
| 125 | 124 | return self._hash | |
| 126 | 125 | ||
| 127 | 126 | def __eq__(self, other: Any) -> bool: | |
| 128 | - """Tests equality on dns question.""" | ||
| 129 | 127 | return isinstance(other, DNSQuestion) and self._dns_entry_matches(other) | |
| 130 | 128 | ||
| 131 | 129 | @property | |
@@ -379,11 +377,9 @@ def write(self, out: DNSOutgoing) -> None: | |||
| 379 | 377 | out.write_name(self.alias) | |
| 380 | 378 | ||
| 381 | 379 | def __eq__(self, other: Any) -> bool: | |
| 382 | - """Tests equality on alias.""" | ||
| 383 | 380 | return isinstance(other, DNSPointer) and self._eq(other) | |
| 384 | 381 | ||
| 385 | 382 | def _eq(self, other: DNSPointer) -> bool: | |
| 386 | - """Tests equality on alias.""" | ||
| 387 | 383 | return self.alias_key == other.alias_key and self._dns_entry_matches(other) | |
| 388 | 384 | ||
| 389 | 385 | def __hash__(self) -> int: | |
@@ -425,11 +421,9 @@ def __hash__(self) -> int: | |||
| 425 | 421 | return self._hash | |
| 426 | 422 | ||
| 427 | 423 | def __eq__(self, other: Any) -> bool: | |
| 428 | - """Tests equality on text.""" | ||
| 429 | 424 | return isinstance(other, DNSText) and self._eq(other) | |
| 430 | 425 | ||
| 431 | 426 | def _eq(self, other: DNSText) -> bool: | |
| 432 | - """Tests equality on text.""" | ||
| 433 | 427 | return self.text == other.text and self._dns_entry_matches(other) | |
| 434 | 428 | ||
| 435 | 429 | def __repr__(self) -> str: | |
@@ -508,8 +502,6 @@ def __repr__(self) -> str: | |||
| 508 | 502 | ||
| 509 | 503 | ||
| 510 | 504 | class DNSNsec(DNSRecord): | |
| 511 | - """A DNS NSEC record""" | ||
| 512 | - | ||
| 513 | 505 | __slots__ = ("_hash", "next_name", "rdtypes") | |
| 514 | 506 | ||
| 515 | 507 | def __init__( | |
@@ -560,11 +552,9 @@ def write(self, out: DNSOutgoing) -> None: | |||
| 560 | 552 | out.write_string(out_bytes) | |
| 561 | 553 | ||
| 562 | 554 | def __eq__(self, other: Any) -> bool: | |
| 563 | - """Tests equality on next_name and rdtypes.""" | ||
| 564 | 555 | return isinstance(other, DNSNsec) and self._eq(other) | |
| 565 | 556 | ||
| 566 | 557 | def _eq(self, other: DNSNsec) -> bool: | |
| 567 | - """Tests equality on next_name and rdtypes.""" | ||
| 568 | 558 | return ( | |
| 569 | 559 | self.next_name == other.next_name | |
| 570 | 560 | and self.rdtypes == other.rdtypes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -447,7 +447,6 @@ def _read_record( | |||
| 447 | 447 | return None | |
| 448 | 448 | ||
| 449 | 449 | def _read_bitmap(self, end: _int) -> list[int]: | |
| 450 | - """Reads an NSEC bitmap from the packet.""" | ||
| 451 | 450 | rdtypes = [] | |
| 452 | 451 | if end > self._data_len: | |
| 453 | 452 | raise IncomingDecodeError( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -162,41 +162,6 @@ def add_authorative_answer(self, record: DNSPointer) -> None: | |||
| 162 | 162 | self.authorities.append(record) | |
| 163 | 163 | ||
| 164 | 164 | 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 | - """ | ||
| 200 | 165 | self.additionals.append(record) | |
| 201 | 166 | ||
| 202 | 167 | def _write_byte(self, value: int_) -> None: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,8 +41,6 @@ def service_type_name(type_: str, *, strict: bool = True) -> str: # pylint: dis | |||
| 41 | 41 | """ | |
| 42 | 42 | Validate a fully qualified service name, instance or subtype. [rfc6763] | |
| 43 | 43 | ||
| 44 | - Returns fully qualified service name. | ||
| 45 | - | ||
| 46 | 44 | Domain names used by mDNS-SD take the following forms: | |
| 47 | 45 | ||
| 48 | 46 | <sn> . <_tcp|_udp> . local. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,13 +28,6 @@ | |||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | 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 | - """ | ||
| 38 | 31 | return time.monotonic() * 1000 | |
| 39 | 32 | ||
| 40 | 33 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -171,12 +171,6 @@ async def async_register_service( | |||
| 171 | 171 | ) | |
| 172 | 172 | ||
| 173 | 173 | 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 | - """ | ||
| 180 | 174 | await self.zeroconf.async_unregister_all_services() | |
| 181 | 175 | ||
| 182 | 176 | async def async_unregister_service(self, info: ServiceInfo) -> Awaitable: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments