MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / get

Method get

src/utils/file_state_cache.py:20–33  ·  view source on GitHub ↗
(self, path: str, *, read_through: bool = True)

Source from the content-addressed store, hash-verified

18 self._lock = asyncio.Lock()
19
20 async def get(self, path: str, *, read_through: bool = True) -> str | None:
21 abs_path = os.path.abspath(path)
22 async with self._lock:
23 if abs_path in self._cache:
24 self._cache.move_to_end(abs_path)
25 return self._cache[abs_path]
26
27 if not read_through:
28 return None
29
30 content = await self._read_file(abs_path)
31 if content is not None:
32 await self.set(abs_path, content)
33 return content
34
35 async def set(self, path: str, content: str) -> None:
36 abs_path = os.path.abspath(path)

Callers 15

test_read_throughMethod · 0.95
_fieldFunction · 0.45
_btypeFunction · 0.45
_btextFunction · 0.45
_bcontentFunction · 0.45
extract_message_contentFunction · 0.45
serialize_content_blockFunction · 0.45
_plain_block_linesFunction · 0.45
reset_for_test_onlyFunction · 0.45

Calls 2

_read_fileMethod · 0.95
setMethod · 0.95

Tested by 2

test_read_throughMethod · 0.76