# =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2006-2007 eXe Project, New Zealand Tertiary Education Commission # # This program 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 2 of the License, or # (at your option) any later version. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # =========================================================================== """ The PreferencesPage is responsible for managing eXe preferences """ import logging from twisted.web.resource import Resource from exe.webui import common from exe.webui.renderable import RenderableResource log = logging.getLogger(__name__) class PreferencesPage(RenderableResource): """ The PreferencesPage is responsible for managing eXe preferences """ name = 'preferences' def __init__(self, parent): """ Initialize """ RenderableResource.__init__(self, parent) self.localeNames = [] for locale, translation in self.config.locales.items(): localeName = locale + ": " langName = translation.info().get('x-exe-language', None) if langName == None: langName = translation.info().get('x-poedit-language', 'English') localeName += langName self.localeNames.append((localeName, locale)) self.localeNames.sort() def getChild(self, name, request): """ Try and find the child for the name given """ if name == "": return self else: return Resource.getChild(self, name, request) def render_GET(self, request): """Render the preferences""" log.debug("render_GET") # Rendering html = common.docType() html += u"\n" html += u"
\n" html += u"\n" html += u'''''' html += u"