FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

revert: remove non-consented prose and code from the library by bdraco · Pull Request #1843 · python-zeroconf/python-zeroconf · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (15) All 1 file type selected
Deleted files Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
89 changes: 0 additions & 89 deletions examples/browser.py

This file was deleted.

55 changes: 0 additions & 55 deletions examples/registration.py

This file was deleted.

3 changes: 0 additions & 3 deletions src/zeroconf/_cache.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ def async_entries_with_server(self, name: str) -> list[DNSRecord]:
# inefficient.

def get(self, entry: DNSEntry) -> DNSRecord | None:
"""Gets an entry by key. Will return None if there is no
matching entry."""
if isinstance(entry, _UNIQUE_RECORD_TYPES):
return self.cache.get(entry.key, {}).get(entry)
for cached_entry in reversed(list(self.cache.get(entry.key, {}).values())):
Expand Down Expand Up @@ -303,7 +301,6 @@ def entries_with_server(self, server: str) -> list[DNSRecord]:
return []

def entries_with_name(self, name: str) -> list[DNSRecord]:
"""Returns a list of entries whose key matches the name."""
if entries := self.cache.get(name.lower()):
return list(entries.values())
return []
Expand Down
13 changes: 0 additions & 13 deletions src/zeroconf/_core.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ def async_send_with_transport(


class Zeroconf(QuietLogger):
"""Implementation of Zeroconf Multicast DNS Service Discovery

Supports registration, unregistration, queries and browsing.
"""

def __init__(
self,
Expand All @@ -163,7 +160,6 @@ def __init__(
apple_p2p: bool = False,
use_asyncio: bool | None = None,
) -> None:
"""Creates an instance of the Zeroconf class, establishing
multicast communications, listening and reaping threads.

:param interfaces: :class:`InterfaceChoice` or a list of IP addresses
Expand Down Expand Up @@ -321,20 +317,17 @@ def get_service_info(
return None

def add_service_listener(self, type_: str, listener: ServiceListener) -> None:
"""Adds a listener for a particular service type. This object
will then have its add_service and remove_service methods called when
services of that type become available and unavailable."""
self.remove_service_listener(listener)
self.browsers[listener] = ServiceBrowser(self, type_, listener)

def remove_service_listener(self, listener: ServiceListener) -> None:
"""Removes a listener from the set that is currently listening."""
if listener in self.browsers:
self.browsers[listener].cancel()
del self.browsers[listener]

def remove_all_service_listeners(self) -> None:
"""Removes a listener from the set that is currently listening."""
for listener in list(self.browsers):
self.remove_service_listener(listener)

Expand Down Expand Up @@ -654,8 +647,6 @@ async def async_check_service(
cooperating_responders: bool = False,
strict: bool = True,
) -> None:
"""Checks the network for a unique service name, modifying the
ServiceInfo passed in if it is not unique."""
instance_name = instance_name_from_service_info(info, strict=strict)
if cooperating_responders:
return
Expand Down Expand Up @@ -694,7 +685,6 @@ def add_listener(
listener: RecordUpdateListener,
question: DNSQuestion | list[DNSQuestion] | None,
) -> None:
"""Adds a listener for a given question. The listener will have
its update_record method called when information is available to
answer the question(s).

Expand All @@ -716,7 +706,6 @@ def async_add_listener(
listener: RecordUpdateListener,
question: DNSQuestion | list[DNSQuestion] | None,
) -> None:
"""Adds a listener for a given question. The listener will have
its update_record method called when information is available to
answer the question(s).

Expand Down Expand Up @@ -808,7 +797,6 @@ def _shutdown_threads(self) -> None:
self.loop.close()

def close(self) -> None:
"""Ends the background threads, and prevent this instance from
servicing further queries.

This method is idempotent and irreversible.
Expand All @@ -826,7 +814,6 @@ def close(self) -> None:
self._shutdown_threads()

async def _async_close(self) -> None:
"""Ends the background threads, and prevent this instance from
servicing further queries.

This method is idempotent and irreversible.
Expand Down
Loading
Loading

Back | FazBrowse Home | New Git URL