MCPcopy Index your code
hub / github.com/idank/explainshell / from_store

Method from_store

explainshell/models.py:173–204  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

171
172 @staticmethod
173 def from_store(d):
174 options = []
175 for od in json.loads(d["options"]):
176 options.append(Option.model_validate(od))
177
178 synopsis = d["synopsis"]
179 if not synopsis:
180 synopsis = help_constants.NO_SYNOPSIS
181
182 dashless_opts = bool(d["dashless_opts"])
183 subcommands = json.loads(d["subcommands"])
184 nested_cmd = json.loads(d["nested_cmd"])
185
186 extraction_meta_raw = d["extraction_meta"]
187 meta_dict = json.loads(extraction_meta_raw) if extraction_meta_raw else {}
188 extraction_meta = (
189 ExtractionMeta.model_validate(meta_dict) if meta_dict else None
190 )
191
192 return ParsedManpage(
193 source=d["source"],
194 name=d["name"],
195 synopsis=synopsis,
196 options=options,
197 aliases=[tuple(x) for x in json.loads(d["aliases"])],
198 dashless_opts=dashless_opts,
199 subcommands=subcommands,
200 updated=bool(d["updated"]),
201 nested_cmd=nested_cmd,
202 extractor=d["extractor"],
203 extraction_meta=extraction_meta,
204 )
205
206 def __repr__(self):
207 return f"<manpage {self.name}({self.section}), {len(self.options)} options>"

Callers 1

find_man_pageMethod · 0.80

Calls 1

ParsedManpageClass · 0.85

Tested by

no test coverage detected