You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
616 B
22 lines
616 B
from model.data import Data
|
|
|
|
from lib.snabbdom import h
|
|
|
|
|
|
class Explanation(Data):
|
|
def __init__(self):
|
|
self.value = ""
|
|
self.language = ""
|
|
|
|
def import_dom(self, explanation_dom):
|
|
|
|
self.value = explanation_dom.textContent if explanation_dom else ""
|
|
self.language = explanation_dom.getAttribute("language") if explanation_dom.hasAttribute("language") else ""
|
|
|
|
def export(self, doc):
|
|
result = doc.createElement("explanation")
|
|
result.textContent = self.value
|
|
if self.language != "": result.setAttribute('language', self.language)
|
|
|
|
return result
|