[Pywps-commits] r502 - in trunk/pywps: . Parser WPS
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jul 17 16:32:35 CEST 2008
Author: jachym
Date: 2008-07-17 16:32:35 +0200 (Thu, 17 Jul 2008)
New Revision: 502
Modified:
trunk/pywps/InAndOutputs.py
trunk/pywps/Parser/Get.py
trunk/pywps/Parser/Parser.py
trunk/pywps/WPS/Execute.py
Log:
control of ugly input characters moved from Get parser to LiteralInput class
Modified: trunk/pywps/InAndOutputs.py
===================================================================
--- trunk/pywps/InAndOutputs.py 2008-07-17 14:18:28 UTC (rev 501)
+++ trunk/pywps/InAndOutputs.py 2008-07-17 14:32:35 UTC (rev 502)
@@ -50,6 +50,7 @@
self.dataType = dataType
self.uoms = uoms
+ self.restrictedCharacters = ['\\',"#",";", "&","!"]
if type(values) == types.StringType:
self.values = (values)
self.default = default
@@ -76,8 +77,12 @@
Control input value
"""
- # type first
+ # ugly characters
+ for char in self.restrictedCharacters:
+ if value.find(char) > -1:
+ raise self.wps.exceptions.InvalidParameterValue(value)
+ # type
try:
if self.dataType == types.FloatType:
value = float(value)
Modified: trunk/pywps/Parser/Get.py
===================================================================
--- trunk/pywps/Parser/Get.py 2008-07-17 14:18:28 UTC (rev 501)
+++ trunk/pywps/Parser/Get.py 2008-07-17 14:32:35 UTC (rev 502)
@@ -67,7 +67,6 @@
for key in self.unparsedInputs.keys():
value = self.unparsedInputs[key]
- value = self.control(value)
# check size
if self.wps.maxInputLength > 0 and\
Modified: trunk/pywps/Parser/Parser.py
===================================================================
--- trunk/pywps/Parser/Parser.py 2008-07-17 14:18:28 UTC (rev 501)
+++ trunk/pywps/Parser/Parser.py 2008-07-17 14:32:35 UTC (rev 502)
@@ -19,16 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
class Parser:
- #restrictedCharacters = ['\\',"#",";", "&","!"]
- # we need ";" for HTTP GET
- # FIXME
- restrictedCharacters = ['\\',"#", "&","!"]
def __init__(self,wps):
self.wps = wps
- def control(self,string):
- for char in self.restrictedCharacters:
- if string.find(char) > -1:
- raise self.wps.exceptions.InvalidParameterValue(string)
- return string
Modified: trunk/pywps/WPS/Execute.py
===================================================================
--- trunk/pywps/WPS/Execute.py 2008-07-17 14:18:28 UTC (rev 501)
+++ trunk/pywps/WPS/Execute.py 2008-07-17 14:32:35 UTC (rev 502)
@@ -78,6 +78,7 @@
rawDataOutput = None
+
def __init__(self,wps):
"""
wps - parent WPS instance
@@ -741,3 +742,4 @@
print "Content-type: %s\n" % output.format["mimeType"]
print f.read()
f.close()
+
More information about the Pywps-commits
mailing list