← 输入框|github.com|刷新
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,6 @@ Here's how to discover services:

.. code-block:: python

from zeroconf import ServiceBrowser, ServiceListener, Zeroconf


class MyListener(ServiceListener):

def update_service(self, zc: Zeroconf, type_: str, name: str) -> None:
print(f"Service {name} updated")

def remove_service(self, zc: Zeroconf, type_: str, name: str) -> None:
print(f"Service {name} removed")

def add_service(self, zc: Zeroconf, type_: str, name: str) -> None:
info = zc.get_service_info(type_, name)
print(f"Service {name} added, service info: {info}")


zeroconf = Zeroconf()
listener = MyListener()
browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener)
try:
input("Press enter to exit...\n\n")
finally:
zeroconf.close()

.. note::

Expand Down
133 changes: 0 additions & 133 deletions examples/async_apple_scanner.py

This file was deleted.

107 changes: 0 additions & 107 deletions examples/async_service_info_request.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/zeroconf/_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,6 @@ def __hash__(self) -> int:
"""Hash to compare like DNSText."""
return self._hash

def __repr__(self) -> str:
if len(self.text) > 10:
return self.to_string(self.text[:7]) + "..."
return self.to_string(self.text)

def write(self, out: DNSOutgoing) -> None:
out.write_string(self.text)

Expand Down
Loading