mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2026-01-01 09:20:40 +00:00
Begun implementation
This commit is contained in:
41
wavinfo/wave_ixml_reader.py
Normal file
41
wavinfo/wave_ixml_reader.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
class WavIXMLFormat:
|
||||
"""
|
||||
iXML recorder metadata, as defined by iXML 2.0
|
||||
"""
|
||||
def __init__(xml):
|
||||
self.source = xml
|
||||
self.parsed = ET.fromstring(xml)
|
||||
|
||||
def _get_text_value(xpath):
|
||||
root = self.parsed.getroot()
|
||||
e = root.find("//BWFXML/" + xpath)
|
||||
if e:
|
||||
return e.text
|
||||
|
||||
@property
|
||||
def project(self):
|
||||
return _get_text_value("PROJECT")
|
||||
|
||||
@property
|
||||
def scene(self):
|
||||
return _get_text_value("SCECE")
|
||||
|
||||
@property
|
||||
def take(self):
|
||||
return _get_text_value("TAKE")
|
||||
|
||||
@property
|
||||
def tape(self):
|
||||
return _get_text_value("TAPE")
|
||||
|
||||
@property
|
||||
def family_uid(self):
|
||||
return _get_text_value("FILE_SET/FAMILY_UID")
|
||||
|
||||
@property
|
||||
def family_name(self):
|
||||
return _get_text_value("FILE_SET/FAMILY_NAME")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user