mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 17:00:41 +00:00
Removed premature decoding of iXML bytes
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user