MCPcopy Create free account
hub / github.com/idank/explainshell / has_mapping

Method has_mapping

explainshell/store.py:436–441  ·  view source on GitHub ↗

Return whether a mapping from *src* to *dst* already exists.

(self, src: str, dst: str)

Source from the content-addressed store, hash-verified

434 self._conn.commit()
435
436 def has_mapping(self, src: str, dst: str) -> bool:
437 """Return whether a mapping from *src* to *dst* already exists."""
438 row = self._conn.execute(
439 "SELECT 1 FROM mappings WHERE src = ? AND dst = ? LIMIT 1", (src, dst)
440 ).fetchone()
441 return row is not None
442
443 def mapping_score(self, src: str, dst: str) -> int | None:
444 """Return the score of the mapping from *src* to *dst*, or None."""

Calls

no outgoing calls