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

Method distros_for_name

explainshell/store.py:414–428  ·  view source on GitHub ↗

Return (distro, release) pairs that have a manpage matching *name*.

(self, name: str)

Source from the content-addressed store, hash-verified

412 return [(row["distro"], row["release"]) for row in rows]
413
414 def distros_for_name(self, name: str) -> list[tuple[str, str]]:
415 """Return (distro, release) pairs that have a manpage matching *name*."""
416 rows = self._conn.execute(
417 """
418 SELECT DISTINCT
419 SUBSTR(pm.source, 1, INSTR(pm.source, '/') - 1) as distro,
420 SUBSTR(pm.source, INSTR(pm.source, '/') + 1,
421 INSTR(SUBSTR(pm.source, INSTR(pm.source, '/') + 1), '/') - 1) as release
422 FROM mappings m
423 JOIN parsed_manpages pm ON pm.source = m.dst
424 WHERE m.src = ?
425 """,
426 (name,),
427 ).fetchall()
428 return [(row["distro"], row["release"]) for row in rows]
429
430 def add_mapping(self, src: str, dst: str, score: int) -> None:
431 self._conn.execute(

Callers 2

_handle_explain_cmdFunction · 0.80
_handle_explain_programFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected