From 21a8e014ef3911201f017833cc8fc2fa9f3b288b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=B6rner?= Date: Thu, 21 Nov 2024 19:32:20 +0100 Subject: [PATCH] make-apple-motion: replace xml.sax.saxutils.xmlescape with custom routine, which also escapes quotes xml.sax.saxutils.xmlescape is only a str.replace in a trencoat anyways. --- make-apple-motion.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/make-apple-motion.py b/make-apple-motion.py index f4317c4..c2940e9 100755 --- a/make-apple-motion.py +++ b/make-apple-motion.py @@ -11,8 +11,6 @@ import sys import os import re -from xml.sax.saxutils import escape as xmlescape - # Parse arguments parser = argparse.ArgumentParser( description='C3VOC Intro-Outro-Generator - Variant to use with apple Motion Files', @@ -155,6 +153,13 @@ def run_output(command, **kwargs): os.system(f'{cmd} >{t.name} 2>&1') return t.read().decode('utf-8') +def xmlescape(xml): + xml = xml.replace("&", "&") + xml = xml.replace("<", "<") + xml = xml.replace(">", ">") + xml = xml.replace("\"", """) + xml = xml.replace("'", "'") + return xml def enqueue_job(event): event_id = str(event['id'])