required audio support #1351

This commit is contained in:
matic_t
2020-08-06 05:39:24 -07:00
parent 1770932a14
commit efe4d07464
3 changed files with 10 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ class Entry(Data):
self.headword = ""
self.homonymy = []
self.headword_type = None
self.headword_audio = None
self.grammar = ""
self.comment = ""
self.variants = []
@@ -31,7 +32,8 @@ class Entry(Data):
comment = entry_xml.querySelector("head comment")
self.status = status.textContent if status else ""
self.headword = headword.textContent if headword else ""
self.headword_type = headword.getAttribute("type") if headword else None
self.headword_type = headword.getAttribute("type") if .hasAttribute("type") else None
self.headword_audio = headword.getAttribute("audio") if headword.hasAttribute("audio") else None
self.grammar = grammar.textContent if grammar else ""
self.comment = comment.textContent if comment else ""
self.variants = [v.textContent for v in entry_xml.querySelectorAll("head variantList variant")]

View File

@@ -33,6 +33,7 @@ class Translation(Data):
self.translation = ""
self.source = ""
self.targetLang = ""
self.audio = ""
self.explanation = ""
self.explanationList = []
self.tags = []
@@ -44,6 +45,7 @@ class Translation(Data):
self.translation = translation.textContent
self.source = translation.getAttribute("source") if translation.hasAttribute("source") else ""
self.targetLang = translation.getAttribute("targetLang") if translation.hasAttribute("targetLang") else ""
self.audio = translation.getAttribute("audio") if translation.hasAttribute("audio") else ""
explanationList = translation_xml.querySelectorAll("explanationList explanation")