|
95 | 95 | str_ = str |
96 | 96 |
|
97 | 97 | _QuestionWithKnownAnswers = dict[DNSQuestion, set[DNSPointer]] |
| 98 | +DNSPointer_ = DNSPointer |
| 99 | +DNSOutgoing_ = DNSOutgoing |
| 100 | +RecordUpdate_ = RecordUpdate |
98 | 101 |
|
99 | 102 | heappop = heapq.heappop |
100 | 103 | heappush = heapq.heappush |
@@ -193,7 +196,7 @@ def __init__(self, now_millis: float, multicast: bool) -> None: |
193 | 196 | self.out = DNSOutgoing(_FLAGS_QR_QUERY, multicast) |
194 | 197 | self.bytes = 0 |
195 | 198 |
|
196 | | - def add(self, max_compressed_size: int_, question: DNSQuestion, answers: set[DNSPointer]) -> None: |
| 199 | + def add(self, max_compressed_size: int_, question: DNSQuestion, answers: set[DNSPointer_]) -> None: |
197 | 200 | """Add a new set of questions and known answers to the outgoing.""" |
198 | 201 | self.out.add_question(question) |
199 | 202 | for answer in answers: |
@@ -259,10 +262,10 @@ def _group_ptr_queries_with_known_answers( |
259 | 262 | def generate_service_query( |
260 | 263 | zc: Zeroconf, |
261 | 264 | now_millis: float_, |
262 | | - types_: set[str], |
| 265 | + types_: set[str_], |
263 | 266 | multicast: bool, |
264 | 267 | question_type: DNSQuestionType | None, |
265 | | -) -> list[DNSOutgoing]: |
| 268 | +) -> list[DNSOutgoing_]: |
266 | 269 | """Generate a service query for sending with zeroconf.send.""" |
267 | 270 | questions_with_known_answers: _QuestionWithKnownAnswers = {} |
268 | 271 | qu_question = not multicast if question_type is None else question_type is QU_QUESTION |
@@ -533,7 +536,7 @@ def _process_ready_types(self) -> None: |
533 | 536 | self._next_run = self._loop.call_at(millis_to_seconds(next_when_millis), self._process_ready_types) |
534 | 537 |
|
535 | 538 | def async_send_ready_queries( |
536 | | - self, first_request: bool, now_millis: float_, ready_types: set[str] |
| 539 | + self, first_request: bool, now_millis: float_, ready_types: set[str_] |
537 | 540 | ) -> None: |
538 | 541 | """Send any ready queries.""" |
539 | 542 | # If they did not specify and this is the first request, ask QU questions |
@@ -665,7 +668,7 @@ def _enqueue_callback( |
665 | 668 | ): |
666 | 669 | self._pending_handlers[key] = state_change |
667 | 670 |
|
668 | | - def async_update_records(self, zc: Zeroconf, now: float_, records: list[RecordUpdate]) -> None: |
| 671 | + def async_update_records(self, zc: Zeroconf, now: float_, records: list[RecordUpdate_]) -> None: |
669 | 672 | """Callback invoked by Zeroconf when new information arrives. |
670 | 673 |
|
671 | 674 | Updates information required by browser in the Zeroconf cache. |
|
0 commit comments