BE: docstrings

This commit is contained in:
jokob-sk committed 2026-09-28 07:44:29 +10:00
1 parent c5081ba4c1
commit f0a833ccc8
2 files changed
+7

No files matched your search

+5
View File
@@ -572,6 +572,11 @@ def save_own_device(db):
# -------------------------------------------------------------------------------
def print_scan_stats(db):
"""
Log diagnostic scan-cycle counts (devices detected, new devices, down
alerts, new connections, disconnections, IP changes, per-plugin scan
method counts) at verbose/trace log levels. No return value.
"""
sql = db.sql # TO-DO
query = f"""
+2
View File
@@ -44,6 +44,8 @@ def _run_stats(conn, monkeypatch):
logged = {}
def fake_mylog(level, parts):
"""Stand in for logger.mylog: parse the down_alerts/new_down_alerts
counts straight out of print_scan_stats()'s own log lines."""
text = "".join(parts) if isinstance(parts, list) else str(parts)
if "Down Alerts" in text and "New Down Alerts" not in text:
logged["down_alerts"] = int(text.rsplit(":", 1)[1].strip())