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.
lexonomy_custom_editor/src/model/model.py

31 lines
778 B

5 years ago
from model.entry import Entry
from browser import window
5 years ago
class Model:
def __init__(self, names):
# main data stuff
5 years ago
self.entry = None
# report everything that happens!
5 years ago
self.log = []
#runtime info
self.menu_location = (0, 0)
self.menu_shown = False
self.modal = []
self.modal_shown = False
# currently edited stuff
self.translation = None
self.sense = None
5 years ago
def reset(self):
self.menu_shown = False
self.modal_shown = False
5 years ago
def import_xml(self, xml_text):
parser = __new__(DOMParser())
xmlDoc = parser.parseFromString(xml_text, "text/xml")
self.entry = Entry(xmlDoc.querySelector("entry"))