Coverage for modules/org/openteacher/logic/loaders/kvtml/kvtml : 97%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
#! /usr/bin/env python3 # -*- coding: utf-8 -*-
# Copyright 2011-2012, Marten de Vries # # This file is part of OpenTeacher. # # OpenTeacher is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # OpenTeacher is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with OpenTeacher. If not, see <http://www.gnu.org/licenses/>.
"""Loads .kvtml files (the format of various KDE programs)"""
"default": 770, }
self._mm.mods(type="wordsStringParser"), ) self._mm.mods(type="translator"), )
else: self._mm.resourcePath("translations") ) #TRANSLATORS: This is the name of a file format OT can read.
else:
def _parse(self):
"items": [], "title": root.findtext("information/title") or u"", "questionLanguage": root.findtext("identifiers/identifier[@id='0']/name") or u"", "answerLanguage": root.findtext("identifiers/identifier[@id='1']/name") or u"", } "id": entry.get("id"), "questions": self._parse(entry.findtext("translation[@id='0']/text") or u""), "answers": self._parse(entry.findtext("translation[@id='1']/text") or u""), }
"items": [], "title": root.get("title", u""), }
"id": i, "questions": self._parse(wordTree.findtext("o")), "answers": self._parse(wordTree.findtext("t")), }
"resources": {}, "list": wordList, }
|