From 318e6d0cd0aab02b39dc3fdedbeb7f974b9c105e Mon Sep 17 00:00:00 2001 From: lyra_phasma Date: Thu, 9 Apr 2026 18:59:37 +0000 Subject: [PATCH] Add scripts/patch-weboffice-collabora-yaml.py --- scripts/patch-weboffice-collabora-yaml.py | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/patch-weboffice-collabora-yaml.py diff --git a/scripts/patch-weboffice-collabora-yaml.py b/scripts/patch-weboffice-collabora-yaml.py new file mode 100644 index 0000000..5001434 --- /dev/null +++ b/scripts/patch-weboffice-collabora-yaml.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +from ruamel.yaml import YAML +from pathlib import Path +import sys + +yaml = YAML() +yaml.preserve_quotes = True + +path = Path(sys.argv[1]) + +with path.open("r") as f: + data = yaml.load(f) + +extra = data["services"]["collabora"]["environment"]["extra_params"] + +# normalize to string +extra_str = str(extra) + +if "--o:hexify_embedded_urls=true" in extra_str: + print("[patch-weboffice-collabora-yaml] already patched") + sys.exit(0) + +lines = extra_str.splitlines() + +lines.append(" --o:hexify_embedded_urls=true") + +data["services"]["collabora"]["environment"]["extra_params"] = "\n".join(lines) + +with path.open("w") as f: + yaml.dump(data, f) + +print("[patch-weboffice-collabora-yaml] patched successfully") \ No newline at end of file