Removed premature decoding of iXML bytes

This commit is contained in:
Jamie Hardt
2019-01-02 00:17:20 -08:00
parent 9f943aeb61
commit 3e897d030c
2 changed files with 6 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
import xml.etree.ElementTree as ET
import io
class WavIXMLFormat:
"""
@@ -6,17 +7,18 @@ class WavIXMLFormat:
"""
def __init__(self, xml):
self.source = xml
self.parsed = ET.fromstring(xml)
xmlBytes = io.BytesIO(xml)
self.parsed = ET.parse(xmlBytes)
def _get_text_value(self, xpath):
e = self.parsed.find("./" + xpath)
if e is not None:
return e.text
@property
def project(self):
return self._get_text_value("PROJECT")
@property
def scene(self):
return self._get_text_value("SCENE")

View File

@@ -118,7 +118,7 @@ class WavInfoReader():
if ixml_data is None:
return None
ixml_string = ixml_data.decode('utf-8')
ixml_string = ixml_data
return WavIXMLFormat(ixml_string)