mirror of
https://github.com/9001/copyparty.git
synced 2026-04-02 22:08:38 +10:00
release-automation
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user