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

Method to_store

explainshell/models.py:155–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

153 return o_tmp
154
155 def to_store(self):
156 meta = self.extraction_meta or ExtractionMeta()
157 meta_json = json.dumps(meta.model_dump(exclude_none=True))
158 return {
159 "source": self.source,
160 "name": self.name,
161 "synopsis": self.synopsis,
162 "options": json.dumps([o.model_dump() for o in self.options]),
163 "aliases": json.dumps(self.aliases),
164 "dashless_opts": int(bool(self.dashless_opts)),
165 "subcommands": json.dumps(self.subcommands),
166 "updated": int(bool(self.updated)),
167 "nested_cmd": json.dumps(self.nested_cmd),
168 "extractor": self.extractor,
169 "extraction_meta": meta_json,
170 }
171
172 @staticmethod
173 def from_store(d):

Callers 1

add_manpageMethod · 0.80

Calls 1

ExtractionMetaClass · 0.85

Tested by

no test coverage detected