MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / __init__

Method __init__

src/pyspector/ast_cache.py:254–271  ·  view source on GitHub ↗
(
        self,
        cache_dir: Optional[Path] = None,
        max_l1_entries: int = MAX_L1_ENTRIES,
    )

Source from the content-addressed store, hash-verified

252 """
253
254 def __init__(
255 self,
256 cache_dir: Optional[Path] = None,
257 max_l1_entries: int = MAX_L1_ENTRIES,
258 ) -> None:
259 self._l1: OrderedDict[str, FileCacheEntry] = OrderedDict()
260 self._max_l1 = max_l1_entries
261 self._cache_dir: Optional[Path] = None
262 if cache_dir:
263 try:
264 cache_dir.mkdir(parents=True, exist_ok=True)
265 self._cache_dir = cache_dir
266 except OSError as e:
267 warnings.warn(
268 f"PySpector: cannot create cache directory {cache_dir!r}: {e}. "
269 "Disk cache disabled for this run.",
270 stacklevel=2,
271 )
272
273 # ── Public API ───────────────────────────────────────────────────────────
274

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected