Coverage for modules/org/openteacher/logic/loaders/kgm/kgm : 92%
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 2012-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/>.
"default": 800, } self._mm.mods(type="translator"), )
#Feed the xml parser #load the map, in various later needed formats
#iterate over all places ('divisions') #unimportant division: skip "id": counter, "name": division.findtext("name") or u"", }
#get the color the place has on the map
#get the average pixel with that color. This is done by #iterating over all pixels and using them to calculate an #average if the color matches. #save the averages as coordinate.
"resources": { "mapPath": mapPath, # not entirely accurate, but good enough for now. "mapScreenshot": mapPath, }, "list": { "items": items, }, }
global Image except ImportError: # pragma: no cover #remain inactive. If someone doesn't have PIL installed, #the program can just function but just not import .kgm. return
except IndexError: pass else:
except IndexError: _, ngettext = str, lambda a, b, n: a if n == 1 else b else: self._mm.resourcePath("translations") ) #TRANSLATORS: This is the name of an application. For more info #TRANSLATORS: about KGeography: http://edu.kde.org/applications/all/kgeography/
global Image
|