Coverage for modules/org/openteacher/interfaces/qt/dialogs/documentation/documentation : 78%
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-2013, 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/>.
global OpenTeacherWebPage, DocumentationDialog
"""The documentation dialog. It shows the (html) user documentation of OpenTeacher. First it tries to fetch the online resource (it can be newer), otherwise it uses the offline fallback.
"""
if not ok: html = self.getFallbackHtml() self.view.setHtml(html)
#self.page is retranslated by the updateLanguage call done on a #higher level
b'Accept-Language': language.encode('ascii'), b'User-Agent': self.userAgent.encode('ascii'), }
"""This module provides the documentation dialog."""
self._mm.mods(type="metadata"), self._mm.mods(type="ui"), self._mm.mods(type="userDocumentation"), self._mm.mods(type="userDocumentationWrapper"), self._mm.mods(type='webEngine'), ) self._mm.mods(type="translator"), )
userDocumentationModule = self._modules.default("active", type="userDocumentation") userDocumentationWrapperModule = self._modules.default("active", type="userDocumentationWrapper")
baseUrl = "file://" + os.path.abspath(userDocumentationModule.resourcesPath) html = userDocumentationModule.getHtml(baseUrl) return userDocumentationWrapperModule.wrap(html)
createView, self._metadata["documentationUrl"], self._metadata["userAgent"], self._getFallbackHtml, )
global QtWidgets except ImportError: return
#load translator except IndexError: pass else:
#load translator global _ global ngettext
except IndexError: _, ngettext = str, lambda a, b, n: a if n == 1 else b language = "en" else: self._mm.resourcePath("translations") )
|