From 0d5310eb4b9255e9f6e7c080dd3110a7c6dd044b 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 --- instance/intercept.db | Bin 32768 -> 32768 bytes utils/cleanup.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/instance/intercept.db b/instance/intercept.db index 72d2235a628c8497446ff8f113c8cd57e92bb329..5e92d249c7e1e2eabdfe17ba3de6dd16437b01c4 100644 GIT binary patch delta 59 xcmZo@U}|V!njp=XI#I@%F?C}Cw>*cDft9hTm5JfxVtFkDXDJeA^L2U61OV9B52^qF delta 59 xcmZo@U}|V!njp=XFj2;tF=1l@w>*cTxs{QLm7&?>VtFkDXDJeA^L2U61OV8c53&FN 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.