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

chore: fresh docstrings for the short-prose sites and readme rewords by bdraco · Pull Request #1850 · 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  (5) .rst  (1) All 2 file types selected
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
4 changes: 4 additions & 0 deletions README.rst
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 @@ -88,6 +88,8 @@ The easiest way to install python-zeroconf is using pip::
How do I use it?
================

Here's how to discover services:

.. code-block:: python

from zeroconf import ServiceBrowser, ServiceListener, Zeroconf
Expand Down Expand Up @@ -120,6 +122,8 @@ How do I use it?
If you want to customize that you need to specify ``interfaces`` argument when
constructing ``Zeroconf`` object (see the code for details).

To see which service types are present on the network, try:

.. code-block:: python

from zeroconf import ZeroconfServiceTypes
Expand Down
2 changes: 2 additions & 0 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 @@ -66,6 +66,8 @@ def _remove_key(cache: _DNSRecordCacheType, key: _str, record: _DNSRecord) -> No


class DNSCache:
"""Store of received DNS records, indexed for fast lookup."""

def __init__(self) -> None:
self.cache: _DNSRecordCacheType = {}
self._expire_heap: list[tuple[float, DNSRecord]] = []
Expand Down
2 changes: 2 additions & 0 deletions src/zeroconf/_dns.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 @@ -296,6 +296,8 @@ def __repr__(self) -> str:


class DNSHinfo(DNSRecord):
"""HINFO record carrying the host's cpu and os strings."""

__slots__ = ("_hash", "cpu", "os")

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions src/zeroconf/_protocol/incoming.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 @@ -235,6 +235,7 @@ def __repr__(self) -> str:
)

def _read_header(self) -> None:
"""Unpack the fixed twelve byte message header."""
offset = self.offset
if offset + 12 > self._data_len:
raise IncomingDecodeError(
Expand All @@ -251,6 +252,7 @@ def _read_header(self) -> None:
self._num_additionals = buf[offset + 10] << 8 | buf[offset + 11]

def _read_questions(self) -> None:
"""Parse the question entries."""
buf = self._buf
questions = self._questions
for _ in range(self._num_questions):
Expand Down
1 change: 1 addition & 0 deletions src/zeroconf/_services/info.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 @@ -252,6 +252,7 @@ def __init__(

@property
def name(self) -> str:
"""Fully qualified name of this service instance."""
return self._name

@name.setter
Expand Down
6 changes: 6 additions & 0 deletions src/zeroconf/_utils/ipaddress.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 @@ -56,14 +56,17 @@ def __hash__(self) -> int:

@property
def is_link_local(self) -> bool:
"""True for a link-local address."""
return self._is_link_local

@property
def is_unspecified(self) -> bool:
"""True for an unspecified address."""
return self._is_unspecified

@property
def is_loopback(self) -> bool:
"""True for a loopback address."""
return self._is_loopback


Expand All @@ -90,14 +93,17 @@ def __hash__(self) -> int:

@property
def is_link_local(self) -> bool:
"""True for a link-local address."""
return self._is_link_local

@property
def is_unspecified(self) -> bool:
"""True for an unspecified address."""
return self._is_unspecified

@property
def is_loopback(self) -> bool:
"""True for a loopback address."""
return self._is_loopback


Expand Down
Loading

Back | FazBrowse Home | New Git URL