Use ruff linter to fix issues and provide consistent formatting

This commit is contained in:
Ian Renton
2026-08-15 08:25:54 +01:00
parent 7391c28cd0
commit af3f82c14d
121 changed files with 1989 additions and 996 deletions
+3 -4
View File
@@ -34,8 +34,7 @@ class LiveDataCache:
try:
callback(value)
except Exception:
logging.exception("Listener raised an exception for key %s", key)
logging.exception(f"Listener raised an exception for key {key}")
def get(self, key, default=None):
with self._lock:
@@ -71,7 +70,7 @@ class LiveDataCache:
try:
self._disk_cache.set("snapshot", data)
except Exception as e:
logging.exception("Failed to write snapshot to %s", self._snapshot_dir, e)
logging.exception(f"Failed to write snapshot to {self._snapshot_dir}")
def _load_snapshot(self):
data = self._disk_cache.get("snapshot")
@@ -84,7 +83,7 @@ class LiveDataCache:
# Only restore entries that would still be within TTL
if now - saved_at < self._ttl:
self._cache[key] = value
logging.info("Loaded snapshot from %s", self._snapshot_dir)
logging.info(f"Loaded snapshot from {self._snapshot_dir}")
def _start_periodic_snapshot(self, interval):
def loop():