6class CommandOutput(typing.TypedDict):
12def save_safari_webarchive(argv: list[str | pathlib.Path]) -> CommandOutput:
14 Run the ``save_safari_webarchive.swift`` script and return the result.
16 cmd = ["swift", "save_safari_webarchive.swift"] + [str(av) for av in argv]
18 proc = subprocess.Popen(
20 stdout=subprocess.PIPE,
21 stderr=subprocess.PIPE,
23 stdout, stderr = proc.communicate()
25 if stdout is not None:
26 stdout = stdout.decode("utf8")
28 if stderr is not None:
29 stderr = stderr.decode("utf8")
32 returncode=proc.returncode,
33 stdout=stdout or None,
34 stderr=stderr or None,