docs: add comprehensive docstrings and inline comments

Add docstrings to all handler functions in daemon/handlers/firewall.py, covering
params, return values, and raised exceptions. Add inline comments to
_config_apply() reconciliation steps and the request body merge order.

Add docstrings across lib/ modules for emit helpers (_emit_str, _emit_int, etc.),
volatile stripping logic, two-layer diff strategy, sync event dispatch, and all
cross-subsystem sync subscribers (DnsToFirewall, WgToFirewall, FirewallToDhcp,
NetworkToAllSync).

Document WireGuard/networkd config parsers and key-value mappers in
system_import.py. Add docstrings to _ep(), Registry.decorator,
setup_logging, and _replace helper across daemon/ and lib/.
This commit is contained in:
2026-07-13 17:26:45 +00:00
parent 2e49dec633
commit c21639b7f1
10 changed files with 510 additions and 17 deletions
+9
View File
@@ -29,6 +29,15 @@ PathLike = str | Endpoint
def _ep(method: str, path: str) -> Endpoint:
"""Construct a frozen (method, path) endpoint tuple.
Args:
method: HTTP method string (e.g. ``'GET'``).
path: URL path pattern.
Returns:
Endpoint tuple suitable for ``registry.register()`` and client calls.
"""
return (method, path)