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.
31 lines
778 B
31 lines
778 B
from model.entry import Entry
|
|
from browser import window
|
|
|
|
class Model:
|
|
def __init__(self, names):
|
|
# main data stuff
|
|
self.entry = None
|
|
|
|
# report everything that happens!
|
|
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
|
|
|
|
def reset(self):
|
|
self.menu_shown = False
|
|
self.modal_shown = False
|
|
|
|
def import_xml(self, xml_text):
|
|
parser = __new__(DOMParser())
|
|
xmlDoc = parser.parseFromString(xml_text, "text/xml")
|
|
self.entry = Entry(xmlDoc.querySelector("entry"))
|
|
|