mirror of
https://github.com/smittix/intercept.git
synced 2026-07-24 00:48:11 -07:00
Fix DataStore subscript access for ADS-B tracking
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 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -99,6 +99,23 @@ class DataStore:
|
|||||||
with self._lock:
|
with self._lock:
|
||||||
return key in self.data
|
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:
|
def cleanup(self) -> int:
|
||||||
"""
|
"""
|
||||||
Remove entries older than max_age.
|
Remove entries older than max_age.
|
||||||
|
|||||||
Reference in New Issue
Block a user