#!/usr/bin/env python2.4 # -*- coding: utf-8 -*- """ WWW-sovellukset (TJTA270) Viikkotehtävän ratkaisu Copyright (c) Esa-Matti Suuronen This file is part of Sokkeli web framework. Sokkeli 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. Sokkeli 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 Sokkeli. If not, see . """ import cgi class SokkeliStorage(cgi.FieldStorage): def getint(self, key, default=None): return int(self.getvalue(key, default)) def getfloat(self, key, default=None): return float(self.getvalue(key, default)) def getintlist(self, key): return [int(value) for value in self.getlist(key)] def getfloatlist(self, key): return [int(value) for value in self.getlist(key)]