release-automation

This commit is contained in:
ed
2025-10-17 21:59:37 +00:00
parent 5d96862c45
commit f73742b6a4
5 changed files with 94 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import os
import re
import socket
import subprocess as sp
@@ -21,6 +22,9 @@ def readclip():
"xclip -selection CLIPBOARD -o",
"pbpaste",
]
if os.getenv("HLPTXT") == "CAT":
cmds = ["cat"]
for cmd in cmds:
try:
return sp.check_output(cmd.split()).decode("utf-8")
@@ -44,7 +48,7 @@ def cnv(src):
while True:
ln = next(src)
if "<font" in ln:
if "<font" in ln or "<span" in ln:
if not ln.startswith("<pre>"):
ln = "<pre>" + ln
yield ln
@@ -53,12 +57,14 @@ def cnv(src):
for ln in src:
ln = ln.rstrip()
t = ln
if re.search(r"^<font[^>]+>copyparty v[0-9]", ln):
if re.search(r"^<(font|span)[^>]+>copyparty v[0-9]", ln):
in_sfx = 3
if in_sfx:
in_sfx -= 1
if not skip_sfx:
yield ln
elif not in_sfx:
yield "<span>"
continue
if '">uuid:' in ln:
ln = re.sub(r">uuid:[0-9a-f-]{36}<", ">autogenerated<", ln)