From 5d223bc3183aa3c66b67934115b7d6e953a23f96 Mon Sep 17 00:00:00 2001 From: Smittix Date: Tue, 6 Jan 2026 20:35:51 +0000 Subject: [PATCH] Fix DataStore subscript access for ADS-B tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add __getitem__, __setitem__, and __delitem__ methods to DataStore class to support dict-style subscript notation (store[key]). Fixes TypeError: 'DataStore' object is not subscriptable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- utils/cleanup.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/utils/cleanup.py b/utils/cleanup.py index b5e3b5a..1ea2cf8 100644 --- a/utils/cleanup.py +++ b/utils/cleanup.py @@ -99,6 +99,23 @@ class DataStore: with self._lock: return key in self.data + def __getitem__(self, key: str) -> Any: + """Get an entry using subscript notation.""" + with self._lock: + return self.data[key] + + def __setitem__(self, key: str, value: Any) -> None: + """Set an entry using subscript notation.""" + with self._lock: + self.data[key] = value + self.timestamps[key] = time.time() + + def __delitem__(self, key: str) -> None: + """Delete an entry using subscript notation.""" + with self._lock: + del self.data[key] + del self.timestamps[key] + def cleanup(self) -> int: """ Remove entries older than max_age.