| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,7 @@ def build(setup_kwargs: Any) -> None: | |||
| 33 | 33 | "src/zeroconf/_handlers/record_manager.py", | |
| 34 | 34 | "src/zeroconf/_handlers/query_handler.py", | |
| 35 | 35 | "src/zeroconf/_services/registry.py", | |
| 36 | + "src/zeroconf/_updates.py", | ||
| 36 | 37 | "src/zeroconf/_utils/time.py", | |
| 37 | 38 | ], | |
| 38 | 39 | compiler_directives={"language_level": "3"}, # Python 3 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,6 +50,7 @@ | |||
| 50 | 50 | from ._logger import QuietLogger, log # noqa # import needed for backwards compat | |
| 51 | 51 | from ._protocol.incoming import DNSIncoming # noqa # import needed for backwards compat | |
| 52 | 52 | from ._protocol.outgoing import DNSOutgoing # noqa # import needed for backwards compat | |
| 53 | + from ._record_update import RecordUpdate | ||
| 53 | 54 | from ._services import ( # noqa # import needed for backwards compat | |
| 54 | 55 | ServiceListener, | |
| 55 | 56 | ServiceStateChange, | |
@@ -65,7 +66,7 @@ | |||
| 65 | 66 | ServiceRegistry, | |
| 66 | 67 | ) | |
| 67 | 68 | from ._services.types import ZeroconfServiceTypes | |
| 68 | - from ._updates import RecordUpdate, RecordUpdateListener | ||
| 69 | + from ._updates import RecordUpdateListener | ||
| 69 | 70 | from ._utils.name import service_type_name # noqa # import needed for backwards compat | |
| 70 | 71 | from ._utils.net import ( # noqa # import needed for backwards compat | |
| 71 | 72 | InterfaceChoice, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ | |||
| 26 | 26 | import threading | |
| 27 | 27 | from typing import TYPE_CHECKING, List, Optional, cast | |
| 28 | 28 | ||
| 29 | - from ._updates import RecordUpdate | ||
| 29 | + from ._record_update import RecordUpdate | ||
| 30 | 30 | from ._utils.asyncio import get_running_loop, run_coro_with_timeout | |
| 31 | 31 | from ._utils.time import current_time_millis | |
| 32 | 32 | from .const import _CACHE_CLEANUP_INTERVAL | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,8 @@ | |||
| 26 | 26 | from .._dns import DNSQuestion, DNSRecord | |
| 27 | 27 | from .._logger import log | |
| 28 | 28 | from .._protocol.incoming import DNSIncoming | |
| 29 | - from .._updates import RecordUpdate, RecordUpdateListener | ||
| 29 | + from .._record_update import RecordUpdate | ||
| 30 | + from .._updates import RecordUpdateListener | ||
| 30 | 31 | from .._utils.time import current_time_millis | |
| 31 | 32 | from ..const import _ADDRESS_RECORD_TYPES, _DNS_PTR_MIN_TTL, _TYPE_PTR | |
| 32 | 33 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,30 @@ | |||
| 1 | + """ Multicast DNS Service Discovery for Python, v0.14-wmcbrine | ||
| 2 | + Copyright 2003 Paul Scott-Murphy, 2014 William McBrine | ||
| 3 | + | ||
| 4 | + This module provides a framework for the use of DNS Service Discovery | ||
| 5 | + using IP multicast. | ||
| 6 | + | ||
| 7 | + This library is free software; you can redistribute it and/or | ||
| 8 | + modify it under the terms of the GNU Lesser General Public | ||
| 9 | + License as published by the Free Software Foundation; either | ||
| 10 | + version 2.1 of the License, or (at your option) any later version. | ||
| 11 | + | ||
| 12 | + This library is distributed in the hope that it will be useful, | ||
| 13 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | + Lesser General Public License for more details. | ||
| 16 | + | ||
| 17 | + You should have received a copy of the GNU Lesser General Public | ||
| 18 | + License along with this library; if not, write to the Free Software | ||
| 19 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 | ||
| 20 | + USA | ||
| 21 | + """ | ||
| 22 | + | ||
| 23 | + from typing import NamedTuple, Optional | ||
| 24 | + | ||
| 25 | + from ._dns import DNSRecord | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + class RecordUpdate(NamedTuple): | ||
| 29 | + new: DNSRecord | ||
| 30 | + old: Optional[DNSRecord] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,13 +44,14 @@ | |||
| 44 | 44 | from .._dns import DNSPointer, DNSQuestion, DNSQuestionType | |
| 45 | 45 | from .._logger import log | |
| 46 | 46 | from .._protocol.outgoing import DNSOutgoing | |
| 47 | + from .._record_update import RecordUpdate | ||
| 47 | 48 | from .._services import ( | |
| 48 | 49 | ServiceListener, | |
| 49 | 50 | ServiceStateChange, | |
| 50 | 51 | Signal, | |
| 51 | 52 | SignalRegistrationInterface, | |
| 52 | 53 | ) | |
| 53 | - from .._updates import RecordUpdate, RecordUpdateListener | ||
| 54 | + from .._updates import RecordUpdateListener | ||
| 54 | 55 | from .._utils.name import cached_possible_types, service_type_name | |
| 55 | 56 | from .._utils.time import current_time_millis, millis_to_seconds | |
| 56 | 57 | from ..const import ( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,8 @@ | |||
| 38 | 38 | from .._exceptions import BadTypeInNameException | |
| 39 | 39 | from .._logger import log | |
| 40 | 40 | from .._protocol.outgoing import DNSOutgoing | |
| 41 | - from .._updates import RecordUpdate, RecordUpdateListener | ||
| 41 | + from .._record_update import RecordUpdate | ||
| 42 | + from .._updates import RecordUpdateListener | ||
| 42 | 43 | from .._utils.asyncio import ( | |
| 43 | 44 | _resolve_all_futures_to_none, | |
| 44 | 45 | get_running_loop, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,9 @@ | |||
| 1 | + | ||
| 2 | + import cython | ||
| 3 | + | ||
| 4 | + | ||
| 5 | + cdef class RecordUpdateListener: | ||
| 6 | + | ||
| 7 | + cpdef async_update_records(self, object zc, object now, cython.list records) | ||
| 8 | + | ||
| 9 | + cpdef async_update_records_complete(self) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,17 +20,16 @@ | |||
| 20 | 20 | USA | |
| 21 | 21 | """ | |
| 22 | 22 | ||
| 23 | - from typing import TYPE_CHECKING, List, NamedTuple, Optional | ||
| 23 | + from typing import TYPE_CHECKING, List | ||
| 24 | 24 | ||
| 25 | 25 | from ._dns import DNSRecord | |
| 26 | + from ._record_update import RecordUpdate | ||
| 26 | 27 | ||
| 27 | 28 | if TYPE_CHECKING: | |
| 28 | 29 | from ._core import Zeroconf | |
| 29 | 30 | ||
| 30 | 31 | ||
| 31 | - class RecordUpdate(NamedTuple): | ||
| 32 | - new: DNSRecord | ||
| 33 | - old: Optional[DNSRecord] | ||
| 32 | + float_ = float | ||
| 34 | 33 | ||
| 35 | 34 | ||
| 36 | 35 | class RecordUpdateListener: | |
@@ -50,7 +49,7 @@ def update_record( # pylint: disable=no-self-use | |||
| 50 | 49 | """ | |
| 51 | 50 | raise RuntimeError("update_record is deprecated and will be removed in a future version.") | |
| 52 | 51 | ||
| 53 | - def async_update_records(self, zc: 'Zeroconf', now: float, records: List[RecordUpdate]) -> None: | ||
| 52 | + def async_update_records(self, zc: 'Zeroconf', now: float_, records: List[RecordUpdate]) -> None: | ||
| 54 | 53 | """Update multiple records in one shot. | |
| 55 | 54 | ||
| 56 | 55 | All records that are received in a single packet are passed | |
| Back | FazBrowse Home | New Git URL |
0 commit comments