Get mkvmerge version identifier, or None if mkvmerge is not found in PATH.
()
| 302 | |
| 303 | |
| 304 | def get_mkvmerge_version() -> str | None: |
| 305 | """Get mkvmerge version identifier, or None if mkvmerge is not found in PATH.""" |
| 306 | tool_name = "mkvmerge" |
| 307 | try: |
| 308 | output = subprocess.check_output(args=[tool_name, "--version"], text=True) |
| 309 | except FileNotFoundError: |
| 310 | # mkvmerge doesn't exist on the system |
| 311 | return None |
| 312 | output_split = output.split() |
| 313 | if len(output_split) >= 1 and output_split[0] == tool_name: |
| 314 | return " ".join(output_split[1:]) |
| 315 | # If parsing the version fails, return the entire first line of output. |
| 316 | return output.splitlines()[0] |
| 317 | |
| 318 | |
| 319 | def _query_package_version(dist_name: str, fallback_module: str | None) -> str | None: |
no outgoing calls
no test coverage detected