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

Function parse_distro_release

explainshell/config.py:20–27  ·  view source on GitHub ↗

Extract (distro, release) from a source path. All source paths follow the ``distro/release/section/file.gz`` format: "ubuntu/26.04/1/ps.1.gz" -> ("ubuntu", "26.04")

(source)

Source from the content-addressed store, hash-verified

18
19
20def parse_distro_release(source):
21 """Extract (distro, release) from a source path.
22
23 All source paths follow the ``distro/release/section/file.gz`` format:
24 "ubuntu/26.04/1/ps.1.gz" -> ("ubuntu", "26.04")
25 """
26 parts = source.split("/")
27 return parts[0], parts[1]
28
29
30def source_from_path(gz_path):

Callers 2

test_distro_pathMethod · 0.90
test_different_distroMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_distro_pathMethod · 0.72
test_different_distroMethod · 0.72