logs + comment for upcoming work

This commit is contained in:
matic_t 2020-08-12 06:22:39 -07:00
parent 8049f5ed95
commit 85bf0473e5

View File

@ -9,7 +9,6 @@ def export_to_xml(model):
def export_entry(entry): def export_entry(entry):
console.log(entry)
parser = __new__(DOMParser()) parser = __new__(DOMParser())
doc = parser.parseFromString("<entry />", "text/xml") doc = parser.parseFromString("<entry />", "text/xml")
entry_xml = doc.firstChild entry_xml = doc.firstChild
@ -58,6 +57,7 @@ def export_entry(entry):
lexunit.appendChild(lexeme) lexunit.appendChild(lexeme)
head.appendChild(lexunit) head.appendChild(lexunit)
# Example of keeping original xml and adding changes to it only
grammar_category = entry.original_xml.querySelector("head grammar category") grammar_category = entry.original_xml.querySelector("head grammar category")
if grammar_category is None: if grammar_category is None:
grammar = doc.createElement("grammar") grammar = doc.createElement("grammar")
@ -68,11 +68,7 @@ def export_entry(entry):
grammar_category.textContent = entry.grammar grammar_category.textContent = entry.grammar
head.appendChild(entry.original_xml.querySelector("head grammar")) head.appendChild(entry.original_xml.querySelector("head grammar"))
# if (grammar_category)
# entry.original_xml.querySelector("head grammar category").textContent
# grammar.appendChild(grammar_category)
# head.appendChild(grammar)
if len(entry.measure) > 0: if len(entry.measure) > 0:
measure_list = doc.createElement("measureList") measure_list = doc.createElement("measureList")
@ -182,7 +178,6 @@ def export_translation(doc, translation):
def _export_explanation_list(doc, lst): def _export_explanation_list(doc, lst):
result = doc.createElement('explanationList') result = doc.createElement('explanationList')
for explanation in lst: for explanation in lst:
console.log(explanation)
result.appendChild(explanation.export(doc)) result.appendChild(explanation.export(doc))
return result return result