blob: 6646528454e40e8ab678657a5bb44f2fde9ad465 [file] [log] [blame]
lora-sp435e4672023-03-13 13:53:07 +01001import re
2import sys
3import xml.etree.ElementTree as ET
4
5def escape(file):
6 with open(sys.argv[i], "r+") as f:
lora-sp435e4672023-03-13 13:53:07 +01007 file = f.read()
lora-spf6f000f2023-03-13 14:12:45 +01008 file = re.sub('&(?!gt;|apos;|quot;|lt;|amp;)', '&', file)
lora-sp435e4672023-03-13 13:53:07 +01009 f.seek(0)
10 f.write(file)
11 f.truncate()
12
13for i in range(1, len(sys.argv)):
14 try:
15 ET.parse(sys.argv[i])
16 except:
17 escape(sys.argv[i])
18 #ET.parse(sys.argv[i])
19 #print("sucess")
20
21