Changeset 5284 for cows


Ignore:
Timestamp:
14/05/09 11:35:13 (10 years ago)
Author:
spascoe
Message:

Bug fix to prevent parameters being returned as unicode. New patch version 0.2.5p1.

Location:
cows/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/ows_controller.py

    r5283 r5284  
    124124            raise ValueError("Value of cows.parameter_mode not recognised (%s)" % PARAMETER_MODE) 
    125125 
    126         for k in params: 
    127             if k.lower() == 'x': 
    128                 self._owsParams['i'] = params[k] 
    129             elif k.lower() == 'y': 
    130                 self._owsParams['j'] = params[k] 
    131             else: 
    132                 self._owsParams[k.lower()] = params[k] 
    133                          
     126        #!TODO: unicode is converted here. 
     127        # At some point we need to expect COWS apps to accept unicode 
     128        try: 
     129            for k in params: 
     130                if k.lower() == 'x': 
     131                    self._owsParams['i'] = str(params[k]) 
     132                elif k.lower() == 'y': 
     133                    self._owsParams['j'] = str(params[k]) 
     134                else: 
     135                    self._owsParams[k.lower()] = str(params[k]) 
     136        except UnicodeError: 
     137            raise ValueError("Cannot convert unicode to string.  COWS does not accept unicode parameters") 
    134138    def _fixOwsAction(self, environ): 
    135139        rdict = environ['pylons.routes_dict'] 
  • cows/trunk/setup.py

    r5283 r5284  
    33setup( 
    44    name='cows', 
    5     version='0.2.5', 
     5    version='0.2.5p1', 
    66     
    77    description='CEDA OGC Web Services Framework (COWS).  A framework for creatining integrated OGC web services using Pylons', 
Note: See TracChangeset for help on using the changeset viewer.