Ignore:
Timestamp:
29/06/10 12:51:48 (10 years ago)
Author:
astephen
Message:

fix to submitter to parse args with spaces in correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/controllers/wps.py

    r6949 r7120  
    111111 
    112112    def _parseDataInputs(self, dataInputs): 
     113        """ 
     114        Parses inputs, returns dictionary. 
     115        Applies the following rules: 
     116         * Any values sent with "|" are split into a list. 
     117         * Any values containing a "+" sign will be replaced with spaces in the value. 
     118        """ 
    113119        # If dataInputs is blank return empty dictionary 
    114120        if not dataInputs: 
     
    117123        arg_dict = {} 
    118124        args = dataInputs.split(",") 
     125 
    119126        if len(args) %2 != 0: 
    120127            raise ValueError("Must provide even number of arguments in query string for datainput argument (all comma-separated).") 
     
    123130 
    124131        while len(args) > 0: 
    125             arg,value = args[:2] 
     132            (arg, value) = args[:2] 
    126133            args = args[2:] 
    127134 
     135#            log.warn("VALUE: %s" % value) 
    128136            value = urllib.unquote(value) 
     137            value = value.replace("+", " ") 
     138#            log.warn("VALUE2: %s" % value) 
    129139 
    130140            if value.find("|") > -1: 
     
    189199                 
    190200        # Exceptions here will be caught by COWS 
    191         #!TODO: include more info about the process in the exception by catching and 
    192         #       rethrowing the exception. 
    193201        try: 
    194202            arg_dict = va.validate() 
Note: See TracChangeset for help on using the changeset viewer.