MCPcopy
hub / github.com/LawRefBook/Laws / set

Method set

scripts/request.py:130–136  ·  view source on GitHub ↗
(self, key: str, type: CacheType, data: Any, filetype=None)

Source from the content-addressed store, hash-verified

128 return None
129
130 def set(self, key: str, type: CacheType, data: Any, filetype=None):
131 full_path = self.path(key, type, filetype)
132 with open(full_path, "w") as f:
133 if filetype == "json":
134 json.dump(data, f, ensure_ascii=False, indent=4)
135 else:
136 f.write(data if isinstance(data, str) else str(data))
137
138 def write_law(self, path: Path, data: List[str]):
139 out_path = self.base_path / "out"

Callers 3

getLawListMethod · 0.80
get_law_detailMethod · 0.80
get_htmlMethod · 0.80

Calls 2

pathMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected