mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fix loading of unused chars in xml format
This commit is contained in:
parent
3bc8ae4e3b
commit
fcb38b81cf
1 changed files with 40 additions and 0 deletions
|
|
@ -30,6 +30,38 @@ INT_TAGS = {
|
|||
"deep",
|
||||
"subimages",
|
||||
}
|
||||
|
||||
XML_UNUSED_CHARS = {
|
||||
"�",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
}
|
||||
# Regex to parse array attributes
|
||||
ARRAY_TYPE_REGEX = re.compile(r"^(int|float|string)\[\d+\]$")
|
||||
|
||||
|
|
@ -191,6 +223,14 @@ def parse_oiio_xml_output(xml_string, logger=None):
|
|||
if not xml_string:
|
||||
return output
|
||||
|
||||
# Fix values with ampresand (lazy fix)
|
||||
# - ElementTree can't handle all escaped values with ampresand
|
||||
# e.g. ""
|
||||
for unused_char in XML_UNUSED_CHARS:
|
||||
if unused_char in xml_string:
|
||||
new_char = unused_char.replace("&", "&")
|
||||
xml_string = xml_string.replace(unused_char, new_char)
|
||||
|
||||
if logger is None:
|
||||
logger = logging.getLogger("OIIO-xml-parse")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue